亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

基于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
清新县| 靖宇县| 宝坻区| 柘城县| 宜君县| 天镇县| 阿合奇县| 茌平县| 汝南县| 富源县| 确山县| 竹山县| 衡水市| 萝北县| 子洲县| 金阳县| 洛宁县| 永城市| 灵丘县| 雷州市| 门头沟区| 山阳县| 溧水县| 伊通| 潍坊市| 莫力| 砀山县| 平果县| 红河县| 连江县| 乐昌市| 武胜县| 会理县| 孟村| 南宫市| 卢氏县| 沂源县| 衡阳市| 大冶市| 方山县| 东阿县|