zjdusuwhahjsjdzjsjjejrnd
看了没有什么思路一直打错求解呀
供参考:
#include<stdio.h>
#define M 10001
const char rank[7] = "XEDCBA";
int main()
{
int N, i, cnt, ret;
float x[M] = { 0 };
scanf("%d", &N);
for (i = 0; i < N; i++)
scanf("%f", &x[i]);
for (i = 0, cnt = 0; i < N; i++)
{
ret = (1 * (x[i] >= 0 && x[i] < 60) +
2 * (x[i] >= 60 && x[i] < 70) +
3 * (x[i] >= 70 && x[i] < 80) +
4 * (x[i] >= 80 && x[i] < 90) +
5 * (x[i] >= 90 && x[i] <= 100));
if (ret == 0) cnt++;
printf("%c\n", rank[ret]);
}
printf("%d", cnt);
return 0;
}