帮帮忙,最后一步要如何修改
#include "stdio.h"#include "conio.h"
void input(void)
{
int a, i ;
float sum = 0.0,i1=0.0;
float score[100];
printf("input ren shu:"); /*输入人数*/
scanf("%d", &a);
for (i = 0; i < a; i++) {
printf("input %d de chengji: ", i+1);
scanf("%f", &score[i]);
}
for (i = 0; i < a; i++)
sum += score[i];
printf("sum is :%2f\n", sum); /*求总分*/
printf("\n");
printf("Aver is :%f\n",sum/a); /*求平均分*/
printf("\n");
for (i =0;i < a; i++) { /*求及格人数和及格率*/
if (score[i]>=60)
i1++;
}
printf("jige renshu is %d ren.\n",i1);
printf("\n");
printf("jige renshu de is %f%.\n",i1/a); /*这里不知道怎么修改了..得不到百分数的值,最好是2位小数.*/
}
int main(void)
{
input();
getchar();
while(1) {getchar();}
}