香港云服务器基于C语言实现简单学生成绩管理系统:
#include <stdio.h>
#define MAX_STUDENTS 100
struct Student { int id; char name[50]; float score; };
int main() { struct Student students[MAX_STUDENTS]; int num_students = 0;
printf("Enter the number of students: ");
scanf("%d", &num_students);
if (num_students > MAX_STUDENTS) {
printf("Exceeds maximum number of students.\n");
return 1;
}
for (int i = 0; i < num_students; i++) {
printf("Enter student ID: ");
scanf("%d", &students[i].id);
printf("Enter student name: ");
scanf("%s", students[i].name);
printf("Enter student score: ");
scanf("%f", &students[i].score);
}
printf("\nStudent Information:\n");
printf("ID\tName\tScore\n");
for (int i = 0; i < num_students; i++) {
printf("%d\t%s\t%.2f\n", students[i].id, students[i].name, students[i].score);
}
return 0;
复制代码
}
一诺网络香港免备案专区,提供「香港增强云服务器」和「香港特惠云服务器」两种类型的高可用弹性计算服务,搭载新一代英特尔®至强®铂金处理器,接入CN2低延时高速回国带宽线路,网络访问顺滑、流畅。机房网络架构采用了BGP协议的解决方案可提供多线路互联融合网络,使得不同网络运营商线路的用户都能通过最佳路由实现快速访问。香港云服务器低至29元/月,购买链接:https://www.enuoidc.com/vps.html?typeid=2