[정올] Language Coder_반복제어문1_자가진단4_code539 (C)
두비니
·2020. 3. 14. 01:45
#include <stdio.h>
int main() {
int a, sum = 0, num=0;
float avg;
while (1) {
scanf("%d", &a);
if (a < 100) {
sum += a;
num++;
}
else {
sum += a;
num++;
avg = (float)sum / num;
printf("%d\n", sum);
printf("%.1f", avg);
return 0;
}
}
}
'Coding_Algorithm > 정올 문제풀이' 카테고리의 다른 글
[정올] Language Coder_반복제어문1_자가진단6_code633 (C) (0) | 2020.03.16 |
---|---|
[정올] Language Coder_반복제어문1_자가진단5_code540 (C/Python) (0) | 2020.03.15 |
[정올] Language Coder_반복제어문1_자가진단3_code538 (C) (0) | 2020.03.13 |
[정올] Language Coder_디버깅_형성평가4_code119 (C) (0) | 2020.03.08 |
[정올] Language Coder_반복제어문1_자가진단2_code537 (C) (0) | 2020.03.08 |