#include <iostream>
using namespace std;
int main()
{
int i=1,s=1;
double sum=0;
while(i<=19)
{
sum= s*1.0*i/(i+2)+sum;
i=i+2;
s=-s;
}
cout<<"sum="<<sum<<endl;
}
#include <iostream>
using namespace std;
int main()
{
int x,y,z;
for(x=0;x<20;x++)
for(y=0;y<33;y++)
{
z=100-x-y;
if(5*x+3*y+z/3==100&&z%3==0)
cout<<x<< ", "<<y<<", "<<z<<endl;
}
}
#include <iostream>
using namespace std;
int main( )
{
int i,j,k=6;
for(j=1; j<=5; j++)
cout<<" ";
cout<<"*"<<endl;
for(i=2;i<=5;i++)
{
for(j=1; j<=k-i; j++)
cout<<" ";
cout<<"*";
for(j=1; j<=2*i-3; j++)
cout<<" ";
cout<<"*"<<endl;
}
if(i=6)
cout<<"***********";
cout<<endl;
return 0;
}