sourcecode
سه شنبه 01 مهر 1393, 11:15 صبح
#include "stdafx.h"
#include <iostream>
#include <cstring>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a[20][20],i,j;
for(i=0;i<20;i++)
for(j=i+1;j<20;j++)
{
a[i][j]=2;
}
for(i=1;i<20;i++)
for (j=0;j<i;j++)
{
a[i][j]=0;
}
for(i=0;i<20;i++)
a[i][i]=1;
for(i=0;i<20;i++)
for(j=0;j<20;j++)
{
cout<<a[i][j]<<" ";
if(j==19)
cout<<endl;
}
cout<<endl;
system("pause");
return 0;
}
#include <iostream>
#include <cstring>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a[20][20],i,j;
for(i=0;i<20;i++)
for(j=i+1;j<20;j++)
{
a[i][j]=2;
}
for(i=1;i<20;i++)
for (j=0;j<i;j++)
{
a[i][j]=0;
}
for(i=0;i<20;i++)
a[i][i]=1;
for(i=0;i<20;i++)
for(j=0;j<20;j++)
{
cout<<a[i][j]<<" ";
if(j==19)
cout<<endl;
}
cout<<endl;
system("pause");
return 0;
}