dh-winternagi 님의 블로그
(25206) 너의 평점은 본문
https://www.acmicpc.net/problem/25206
단계별로 풀어보기
6단계(심화 1) 8번째

#include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
double t= 0.0, s= 0.0;
for(int i=0;i<20;i++){
string a, b, c;
cin >> a >> b >> c;
if(c=="P") continue;
int x= b[0]-'0';
t+= x;
if(c=="A+") s+= x*4.5;
else if(c=="A0") s+= x*4.0;
else if(c=="B+") s+= x*3.5;
else if(c=="B0") s+= x*3.0;
else if(c=="C+") s+= x*2.5;
else if(c=="C0") s+= x*2.0;
else if(c=="D+") s+= x*1.5;
else if(c=="D0") s+= x*1.0;
}
cout << s/t;
return 0;
}'백준 (C++) > Solve' 카테고리의 다른 글
| (2566) 최댓값 (0) | 2026.04.11 |
|---|---|
| (2738) 행렬 덧셈 (0) | 2026.04.11 |
| (1316) 그룹 단어 체커 (0) | 2026.04.10 |
| (2941) 크로아티아 알파벳 (0) | 2026.04.10 |
| (1157) 단어 공부 (0) | 2026.04.10 |
