1 Star 0 Fork 0

2018级计科一班罗宇梁/git hub

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
.2.cpp 602 Bytes
Copy Edit Raw Blame History
2018级计科一班罗宇梁 authored 6 years ago . 安抚
#include<stdio.h>
struct student
{
char id[6];
char name[11];
float grade;
};
int main()
{
struct student stu[10];
int i, N;
float sum = 0, average;
scanf("%d\n", &N);
for (i = 0; i < N; i++)
{
scanf("%s%s%f", &stu[i].id, &stu[i].name, &stu[i].grade);
sum += stu[i].grade;
}
average = sum / N;
printf("%.2f\n", average);
for (i = 0; i<N; i++)
{
if (stu[i].grade< average)
{
printf("%s %s\n", stu[i].name, stu[i].id);
}
}
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/luo3090306768/git-hub.git
git@gitee.com:luo3090306768/git-hub.git
luo3090306768
git-hub
git hub
master

Search