Cod sursa(job #389831)

Utilizator thegameDavid Alex thegame Data 2 februarie 2010 12:16:41
Problema Oras Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include<iostream>
#include<fstream>

using namespace std;

int main()
{
	ifstream fin("oras.in");
	ofstream fout("oras.out");

	int n;

	fin>>n;

	for (int j=0;j<n;j++)
	{
		fout<<"\n";
		for (int i=0;i<n;i++)
		{
			if (i==j)
			{
				fout<<0;
			}
			else
			{
				if(i==j-n+1)
					fout<<1;
				else
				{
					if(i-j==1)
					 	fout<<1;
					else
						fout<<0;
			
				}
			}
		}
	}

	system("pause");
	return 0;
}