VioletaBabel
2920번: 음계 본문
#include <iostream>
using namespace std;
int main()
{
int sound[8], u=0;
for (int i = 0; i < 8; ++i)
cin >> sound[i];
for (int i = 0; i < 7; ++i)
{
u = (sound[i + 1] > sound[i]) ? (u + 1) : (u - 1);
}
switch (u)
{
case 7:cout << "ascending"; break;
case -7:cout << "descending"; break;
default:cout << "mixed";
}
}
'백준 > 백준-C++' 카테고리의 다른 글
2560번: 짚신벌레 (실패) (0) | 2017.01.26 |
---|---|
2941번: 크로아티아 알파벳 (0) | 2017.01.26 |
8958번: OX퀴즈 (0) | 2017.01.23 |
11719번: 그대로 출력하기 2 (0) | 2017.01.23 |
11718번: 그대로 출력하기 (0) | 2017.01.23 |
Comments