Notice
Recent Posts
Recent Comments
Link
«   2026/06   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Archives
Today
Total
관리 메뉴

dh-winternagi 님의 블로그

(25206) 너의 평점은 본문

백준 (C++)/Solve

(25206) 너의 평점은

dh-winternagi 2026. 4. 10. 19:52

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