这是一道素组题,关于学生成绩的问题,有总分,平均分,判断班级的大小,分数超出了怎么办等。

#include

using namespace std;

int main()

{

int a[50], i, sum=0, sorce, jishu=0;

for (i = 0; i < 50; i++)

cin >> a[i];

for (i = 0; i < 50; i++)

{

if (a[i] > 100)

jishu = jishu;

else if (a[i] > 1)

jishu = jishu + 1;

else

jishu = jishu;

}

if (jishu > 5)

cout << "大班" << endl;

if (jishu < 5)

cout << "小班" << endl;

for (i = 0; i < 50; i++)

{

if (a[i] > 100)

cout << "错误" << endl;

else if (a[i] >= 80)

cout << "优秀" << endl;

else if (a[i] >= 60)

cout << "及格" << endl;

else if (a[i] >= 0)

cout << "补考" << endl;

else

cout << "错误" << endl;

}

for (i = 0; i < 50; i++)

{

if (a[i] > 100)

sum = sum;

else if (a[i] > 1)

sum = sum + a[i];

else

sum = sum;

}

sorce = sum / jishu;

cout << "总分=" << sum << endl;

cout << "平均分=" << sorce << endl;

return 0;

}

你可能感兴趣的:(这是一道素组题,关于学生成绩的问题,有总分,平均分,判断班级的大小,分数超出了怎么办等。)