全是零
查看原帖
全是零
654928
Zjc20120331楼主2022/1/3 15:36

全是零

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int i, j;
	bool a[105];
	short n;
	
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		for (j = 1; j <= n; j++)
		{
			if (j != i)
			{
				if (a[j])
				{
					a[j] == 0;
				}
				else
				{
					a[j] == 1;
				}
			}
		}
		for (j = 1; j <= n; j++)
		{
			cout << a[j];
		}
		cout << endl;
	}
	
	return 0;
}
2022/1/3 15:36
加载中...