91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

基于C語言實現簡單學生成績管理系統

小億
88
2024-03-08 15:36:23
欄目: 編程語言

#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;

}

0
嘉定区| 元朗区| 新昌县| 商丘市| 杨浦区| 华宁县| 海宁市| 通化县| 山阴县| 龙胜| 内乡县| 新沂市| 海安县| 个旧市| 闽侯县| 朝阳区| 五华县| 宝清县| 澄江县| 青神县| 永春县| 高密市| 盖州市| 达日县| 互助| 余江县| 漳平市| 凤台县| 滁州市| 台北县| 北京市| 长宁县| 铜陵市| 昌江| 肇庆市| 稻城县| 姜堰市| 革吉县| 普陀区| 措美县| 开鲁县|