急求C语言编程答案!!!高手请进!!1

2024-11-01 01:37:04
推荐回答(5个)
回答(1):

虽然觉得你给的三个条件有点混乱,但是还是按照其编写出如下代码。

#include

int main()

{
int score[5]={0};
int sum = 0;
int i = 0;

printf("Please input the score of student(enter after each input and start with s1):\n");

for(i=0; i<5; i++)
{
scanf("%d", &score[i]);
sum += score[i];
}

if(sum < 450)
{
printf("Sorry, you can not get the scholarship.\n");
return 0;
}
if(score[0] < 88 || score[1] < 88 || score[2] < 88 || score[3] <88 || score[4] < 88)
{
printf("Sorry, you can not get the scholarship.\n");
return 0;
}
if(score[0] < 95 || score[1] < 95 || score[2] < 95 || score[3] <80 || score[4] < 80)
{
printf("Sorry, you can not get the scholarship.\n");
return 0;
}

printf("Congradulations! You will get the scholarship!\n");

}

回答(2):

main()
{
int s1,s2,s3,s4,s5;
int a;
scanf("%d,%d,%d,%d,%d",&s1,&s2,&s3,&s4,&s5);
a=s1+s2+s3+s4+s5;
if(a>=450)
if(s1>95)
if(s2>95)
if(s3>95)
if(s4>80)
if(s5>80)
printf("拥有优良条件!");
getch();
}
觉得答案有问题的话可以说下,我会帮你的~~~
好的话就多给点分~~~呵呵~~

回答(3):

你这个问题一点也不严谨
是同时满足上面三个条件呢
还是满足一个就可以呢?
#include
void main(){
int a,b,c,d,e;
int sum;
sum=a+b+c+d+e;
cout<<"请输入五门课的成绩"< cin>>a>>b>>c>>d>>e;
cout< if(sum>450||a>88&&b>88&&c>88&&d>88&&e>88||a>95&&b>95&&c>95&&d>80&&e>80){
cout<<"学习优良奖"< }
else{
cout<<"没门"< }
}

回答(4):

main()
{
int sum=0,s[5];
int i;
for(i=0;i<5;i++)
scanf("%d",&s[i]);
for(i=0;i<5;i++)
sum+=s[i];
if(sum>450 )
printf("yes\n");
else if(sum/4>=88)
printf("yes\n");
else if (s[0]>=95 && s[1]>=95 && s[2]>=95 &&s[3]>=80 && s[4]>=80)
printf(" yes\n");
else
printf("no");
}

回答(5):

你的题目本身就有问题,你仔细看看,“每门课都在88分以上”与“其他两门(非主课)每门成绩在80分以上”互相矛盾!