1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> float get_average(int scores[], int n) { float sum = 0; for (int i = 0; i < n; i++) { sum += scores[i]; } return (sum / n); } int main(void) { float avg_score; int scores[10] = { 67, 55, 43, 80, 93, 84, 75, 90, 88, 40 }; avg_score = get_average(scores, 10); printf("Æò±Õ Á¡¼ö´Â %f ÀÔ´Ï´Ù.", avg_score); } | cs |