c++的编程题 ,高手帮忙

2024-12-26 09:46:00
推荐回答(3个)
回答1:

1.double a,b;
cin>>a;
cin>>b;
if(a>b) cout<else if(a==b) cout<<"these numbers are equal";
else cout<
2.cout<<"Input three different intergers:";
int a,b,c;
cin>>a;
cin>>b;
cin>>c;
while(a==b||a==c||b==c)
{
cout<<"the numbers must be different,please input again:";
cin>>a;
cin>>b;
cin>>c;
}
cout<<"Sum is "<cout<<"Average is "<<(double)(a+b+c)/(double)3<cout<<"Product is "<int sml,lag;
if(a{
if(a {
sml=a;
if(b else lag=b;
}
else{sml=c;lag=b;}
}
else{
if(a else
{
lag=a;
if(b>c) sml=c;
else sml=b;
}
}
cout<<"Smallest is "<cout<<"Lagest is "<3.
*
**
***
****
*****
4.
int num[5];
for(int i=0;i<5;i++)
{cin>>num[i];
}
int max=num[0],mark=0;
for(int i=1;i<5;i++)
{
if(num[i]>max) {max=num[i];mark=i;}
}
cout<<"第"<5.int a;
cin>>a;
if(a%2==0) cout<<"是偶数"<else cout<<"是奇数"<

回答2:

你是在着急交作业吧,这些都是非常简单的题目,还是好好看看书吧,不要投机取巧

回答3:

楼上第4题有一句写错了
cout<<"第"<