1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #define STUDENTS 5 int main(void) { int scores[STUDENTS]; int sum = 0; int i, average; for (i = 0; i < STUDENTS; i++) { printf("ÇлýµéÀÇ ¼ºÀûÀ» ÀÔ·ÂÇϽÿÀ: "); scanf("%d", &scores[i]); } for (i = 0; i < STUDENTS; i++) sum += scores[i]; average = sum / STUDENTS; printf("¼ºÀû Æò±Õ= %d\n", average); return 0; } | cs |