题目内容
写出以下程序的运行结果。#include#define MAXN 100struct student{char name[20];int score;char grade;};void set_grade( struct student *p, int n );int main(){int i, n;struct student stu[MAXN];scanf("%d", &n);for(i = 0; i < n; i++){scanf("%s%d", stu[i].name, &stu[i].score);}set_grade(stu, n);for(i = 0; i < n; i++)printf("%s#%c\n", stu[i].name, stu[i].grade);return 0;}void set_grade(struct student *p, int n){struct student *q = p + n - 1;while(p <= q ){if ( p->score >= 60 )p->grade = 'P';elsep->grade = 'F';p++;}}运行程序时输入4zhao 60liu 75li 53wang 96第1行输出______。第2行输出______。第3行输出______。第4行输出______。
查看答案
搜索结果不匹配?点我反馈
更多问题