Invalid move 是什么意思啊,结果对,但是全wa了
查看原帖
Invalid move 是什么意思啊,结果对,但是全wa了
190991
HYYER楼主2021/9/15 18:33

代码如下

#include<bits/stdc++.h>

using namespace std;

string s;

int main()
{
	ios::sync_with_stdio(false);
	int n,m=0; cin>>n;
	for (int i = 1; i <= n; i++) s[i] = 'o';
	for (int i = n+1; i <= n*2; i++) s[i] = '*';
	int l = n+n+2; s[l-1] = s[l] = '-';	
	int i = n;
	while (i) {
		if (i <= 4) {
			for (int j = 1; j <= l; j++)
		  	  cout<<s[j]; cout<<endl;
			cout<<"ooo*o**--*";
			for (int j = 1; j <= n-i; j++)
			cout<<"o*";
			cout<<endl;
			cout<<"o--*o**oo*";
			for (int j = 1; j <= n-i; j++)
			cout<<"o*";
			cout<<endl;
			cout<<"o*o*o*--o*";
			for (int j = 1; j <= n-i; j++)
			cout<<"o*";
			cout<<endl;
			cout<<"--o*o*o*o*";
			for (int j = 1; j <= n-i; j++)
			cout<<"o*";
			break;
		}
		for (int j = 1; j <= l; j++)
		  cout<<s[j]; cout<<endl;
		swap(s[i],s[l-m-1]);
		swap(s[i+1],s[l-m]);
		m += 2;
		for (int j = 1; j <= l; j++)
		  cout<<s[j]; cout<<endl;
		swap(s[i],s[l-m-1]);
		swap(s[i+1],s[l-m]);
		i--;
	}
 	return 0;
}

求大佬指点

orz

2021/9/15 18:33
加载中...