#include <stdio.h> #include <conio.h> int main() { int work1,work2,work3; int i; int average; int count; typedef char string; string str; for (i=1;i<=5;i++) { printf("please insert your name"); scanf("%s",&str); printf("please insert the grade of work1"); scanf("%d", &work1); printf("please insert the grade of work2"); scanf("%d", &work2); printf("please insert the grade of work3"); scanf("%d", &work3); average=(work1+work2+work3)/3; if (work3>85) average+=5; if (average>=100) count++; average=100; printf("the average of %s is %d\n",str,average); } printf("the numbers of students the accepted 100 as grade final is: %d",count); getch(); return 0; }
|