#include<conio.h>
#include<iostream.h>
main()
{
int a,b,c,d;
for(a=1;a<=10;a+=2)
{c=0;
for(b=10;b>=a;b-=2)
{if(b!=10)
cout<<"+";
cout<<b;
c+=b;
}
cout<<"\t\t\t\t = "<<c<<endl;}
cout<<"\t\t\t\t-------------------- +"<<endl ;
d=10+18+24+28+30;
cout<<"\t\t\t\t "<<d;
getch();
}
0 comments:
Post a Comment