-
정올 546 : 반복제어문2-자가진단6c/기초 2019. 1. 11. 14:12
My Solution
1234567891011121314151617181920212223#include<stdio.h>int main(void){int count,num,sum;printf("과목수 입력 : ");scanf("%d",&count);if(count>10){printf("error");return 0;}int i;for(i=1;i<=count;i++){scanf("%d",&num);sum+=num;}printf("avg : %.1f\n",(float)sum/count);if((float)sum/count>=80){printf("pass");}else{printf("fail");}return 0;}cs 반응형'c > 기초' 카테고리의 다른 글
정올 548 : 반복제어문2 -자가진단8 (0) 2019.01.11 정올 547 : 반복제어문2-자가진단7 (0) 2019.01.11 정올 545 : 반복제어문2-자가진단5 (0) 2019.01.11 정올 544 : 반복제어문2-자가진단4 (0) 2019.01.11 정올 543 : 반복제어문2-자가진단3 (0) 2019.01.11