[ baekjoon ] 25206번 - 너의 평점은
#include #include float al_to_num(char rating[]); int main() { char subject[51]; float score; char rating[3]; float total1 = 0; float total2 = 0; float a; for (int i = 0; i < 20; i++) { scanf("%50s", subject); scanf("%f", &score); scanf("%2s", rating); // 등급 P 인 과목 제외 if (rating[0] != 'P') { a = al_to_num(rating); total1 += score * a; // 학점 * 과목평점 total2 += score; // 학점의 총합 } } printf("%f", tota..
2023.05.23