if문을 이용해서 문제를 풀었습니다.
#include<iostream>
using namespace std;
int main(int argc, char * argv[])
{
int x;
cin >> x;
if(x>=90){
cout << "A" << endl;
}
else if(x>=80){
cout << "B" << endl;
}
else if(x>=70){
cout << "C" << endl;
}
else if(x>=60){
cout << "D" << endl;
}
else{
cout << "F" << endl;
}
return 0;
}
'알고리즘' 카테고리의 다른 글
[C++] 백준 10871번 X보다 작은 수 (0) | 2019.03.05 |
---|---|
[C++] 백준 10817번 세 수 (0) | 2019.03.05 |
[C++] 백준 15552번 빠른 A+B (0) | 2019.03.05 |
[C++] 백준 11721번 열 개씩 끊어 출력하기 (0) | 2019.03.05 |
[C++] 백준 11720번 숫자의 합 (0) | 2019.03.05 |