#include <iostream>
using namespace std;
int A[4]={10,100,1000,10000};
int B[4]={20,200,2000,20000};
int C[4]={30,300,3000,30000};
int D[4]={40,400,4000,40000};
int E[4]={50,500,5000,50000};
int F[4]={60,600,6000,60000};
int G[4]={70,700,7000,70000};
int H[4]={80,800,8000,80000};
int I[4]={90,900,9000,90000};
int sa[4],sb[4],sc[4],sd[4],se[4],sf[4],sg[4],sh[4],si[4];
int k1,k2,k3,k4,k5,k6,k7,k8,k9;
int main(int argc, char **argv)
{
int i,j;
for(i=0;i<4;i++)
{
sa[i]=0;
sb[i]=0;
sc[i]=0;
sd[i]=0;
se[i]=0;
sf[i]=0;
sg[i]=0;
sh[i]=0;
si[i]=0;
}
for(j=0;j<4;j++)
{
for(k1=1;k1<A[j]+1;k1++)
sa[j]+=k1;
for(k2=1;k2<B[j]+1;k2++)
sb[j]+=k2;
for(k3=1;k3<C[j]+1;k3++)
sc[j]+=k3;
for(k4=1;k4<D[j]+1;k4++)
sd[j]+=k4;
for(k5=1;k5<E[j]+1;k5++)
se[j]+=k5;
for(k6=1;k6<F[j]+1;k6++)
sf[j]+=k6;
for(k7=1;k7<G[j]+1;k7++)
sg[j]+=k7;
for(k8=1;k8<H[j]+1;k8++)
sh[j]+=k8;
for(k9=1;k9<I[j]+1;k9++)
si[j]+=k9;
}
for(i=0;i<4;i++)
{
cout<<sa[i]<<" ";
}cout<<endl;
for(i=0;i<4;i++)
{
cout<<sb[i]<<" ";
}cout<<endl;
for(i=0;i<4;i++)
{
cout<<sc[i]<<" ";
}cout<<endl;
for(i=0;i<4;i++)
{
cout<<sd[i]<<" ";
}cout<<endl;
for(i=0;i<4;i++)
{
cout<<se[i]<<" ";
}cout<<endl;
for(i=0;i<4;i++)
{
cout<<sf[i]<<" ";
}cout<<endl;
for(i=0;i<4;i++)
{
cout<<sg[i]<<" ";
}cout<<endl;
for(i=0;i<4;i++)
{
cout<<sh[i]<<" ";
}cout<<endl;
for(i=0;i<4;i++)
{
cout<<si[i]<<" ";
}cout<<endl;
return 0;
}
Interesting dependencies:
55 5050 500500 50005000
210 20100 2001000 200010000
Brak komentarzy:
Prześlij komentarz