Vazifa: Massivlar va matritsalarning xotirada tashkil etilishi.
#include
using namespace std;
int main()
{
srand(time(0));
int a[100][100];
cout<<"n= ";
cin>>n;
for(int i=0; i { for(int j=0; j { a[i][j]=rand()%10; cout< } cout< } cout<<"\n"; cout<<"1-qism\n"; for(int i=0; i { for(int j=0; j { cout< s1+=a[i][j]; } cout< } cout<<"\n"; cout<<"2-qism\n"; for(int i=n/2; i { for(int j=0; j { cout< s2+=a[i][j]; } cout< } cout<<"\n"; cout<<"arif1= "< cout<<"\n"; if(s1==s2) { cout<<"bir biriga teng \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s1>s2) { cout<<"NATIJA 1-qism katta bo'lgandagi \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s2>s1) { cout<<"NATIJA 2-qism katta bo'lgandagi \n"; for(int i=n/2; i { for(int j=0; j { cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
for(int j=0; j {
a[i][j]=rand()%10;
cout< } cout< } cout<<"\n"; cout<<"1-qism\n"; for(int i=0; i { for(int j=0; j { cout< s1+=a[i][j]; } cout< } cout<<"\n"; cout<<"2-qism\n"; for(int i=n/2; i { for(int j=0; j { cout< s2+=a[i][j]; } cout< } cout<<"\n"; cout<<"arif1= "< cout<<"\n"; if(s1==s2) { cout<<"bir biriga teng \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s1>s2) { cout<<"NATIJA 1-qism katta bo'lgandagi \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s2>s1) { cout<<"NATIJA 2-qism katta bo'lgandagi \n"; for(int i=n/2; i { for(int j=0; j { cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
}
cout< }
cout<<"\n";
cout<<"1-qism\n";
for(int i=0; i { for(int j=0; j { cout< s1+=a[i][j]; } cout< } cout<<"\n"; cout<<"2-qism\n"; for(int i=n/2; i { for(int j=0; j { cout< s2+=a[i][j]; } cout< } cout<<"\n"; cout<<"arif1= "< cout<<"\n"; if(s1==s2) { cout<<"bir biriga teng \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s1>s2) { cout<<"NATIJA 1-qism katta bo'lgandagi \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s2>s1) { cout<<"NATIJA 2-qism katta bo'lgandagi \n"; for(int i=n/2; i { for(int j=0; j { cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
cout< s1+=a[i][j]; } cout< } cout<<"\n"; cout<<"2-qism\n"; for(int i=n/2; i { for(int j=0; j { cout< s2+=a[i][j]; } cout< } cout<<"\n"; cout<<"arif1= "< cout<<"\n"; if(s1==s2) { cout<<"bir biriga teng \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s1>s2) { cout<<"NATIJA 1-qism katta bo'lgandagi \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s2>s1) { cout<<"NATIJA 2-qism katta bo'lgandagi \n"; for(int i=n/2; i { for(int j=0; j { cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
s1+=a[i][j];
cout<<"2-qism\n";
for(int i=n/2; i { for(int j=0; j { cout< s2+=a[i][j]; } cout< } cout<<"\n"; cout<<"arif1= "< cout<<"\n"; if(s1==s2) { cout<<"bir biriga teng \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s1>s2) { cout<<"NATIJA 1-qism katta bo'lgandagi \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s2>s1) { cout<<"NATIJA 2-qism katta bo'lgandagi \n"; for(int i=n/2; i { for(int j=0; j { cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
cout< s2+=a[i][j]; } cout< } cout<<"\n"; cout<<"arif1= "< cout<<"\n"; if(s1==s2) { cout<<"bir biriga teng \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s1>s2) { cout<<"NATIJA 1-qism katta bo'lgandagi \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s2>s1) { cout<<"NATIJA 2-qism katta bo'lgandagi \n"; for(int i=n/2; i { for(int j=0; j { cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
s2+=a[i][j];
cout<<"arif1= "< cout<<"\n"; if(s1==s2) { cout<<"bir biriga teng \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s1>s2) { cout<<"NATIJA 1-qism katta bo'lgandagi \n"; for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s2>s1) { cout<<"NATIJA 2-qism katta bo'lgandagi \n"; for(int i=n/2; i { for(int j=0; j { cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
if(s1==s2)
cout<<"bir biriga teng \n";
cout< } cout< } } if(s1>s2) {
if(s1>s2)
cout<<"NATIJA 1-qism katta bo'lgandagi \n";
for(int i=0; i { for(int j=0; j { cout< } cout< } } if(s2>s1) { cout<<"NATIJA 2-qism katta bo'lgandagi \n"; for(int i=n/2; i { for(int j=0; j { cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
cout< } cout< } } if(s2>s1) {
if(s2>s1)
cout<<"NATIJA 2-qism katta bo'lgandagi \n";
for(int i=n/2; i { for(int j=0; j { cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
cout< } cout< } for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
for(int i=0; i { for(int j=0; j { cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
cout< } cout< } } } Download 29,65 Kb.Do'stlaringiz bilan baham:
} }