Home Forums Job & Work Life C 프로그래밍 C 프로그래밍 Name * Password * Email 형 퇴근하고 술한잔하고 이제 왔다. 그냥 하드코딩으로 적다 보니 한군데 오류가 있었고 더블쿼트(")가 제대로 찍히지 않은 문제도 있었다. #include <stdio.h> int main() { int count = 4; float sum = 0.0; float avg = 0.0; float scoreArr[4]; for(int i=0; i<count; i++) { printf("Enter %d score: ", i+1); scanf("%f", &scoreArr[i]); sum += scoreArr[i]; } avg = sum / count; printf("Total points: %f \n", sum); printf("Average scores: %f \n", avg); if(avg>=90) { printf("A"); } else if(80<= avg && avg <90) { printf("B"); } else if(70<= avg && avg <79) { printf("C"); } else if(60<= avg && avg <69) { printf("D"); } else { printf("F"); } } I agree to the terms of service Comment