1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#include <iostream>
using namespace std;
bool diff_poly (int& a , int& b, int& c, int& d, int& e, int& f){
a=a*5;
b=b*4;
c=c*3;
d=d*2;
e=e*1;
f=f*0;
if(a+b+c+d+e+f>0)
{
return true;
}
return false;
}
int main()
{
bool diff;
int a,b,c,d,e,f;
char again;
do
{ // run program untill user wants to stop
cout<<"\nEnter six integers positive or negative:";
cin>>a>>b>>c>>d>>e>>f;
diff=diff_poly(a,b,c,d,e,f);
if(diff=true){
cout<<" "<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<" "<<f<<endl;
}
cout<<"\nDo you want to run progaram again? (y/n):"<<endl;
cin>>again;
}
while((again=='y') || (again=='Y'));
cout<<"\nBye\n";
return 0;
}
|