| //https://www.acmicpc.net/problem/10769 #include <iostream> | |
| using namespace std; | |
| int main(){ | |
| char str[256]; | |
| cin.getline(str, 255); | |
| int cnt[2]={0,0}; | |
| for(int i=0; str[i]!=0; i++){ | |
| if(str[i]==':' && (str[i+1]!=0 && str[i+2]!=0)){ | |
| if(str[i+1]=='-'){ | |
| if(str[i+2]==')') cnt[0]++; | |
| else if(str[i+2]=='(') cnt[1]++; | |
| } | |
| } | |
| } | |
| if(cnt[1]==0 && cnt[0]==0) cout <<"none"; | |
| else if(cnt[0]==cnt[1]) cout <<"unsure"; | |
| else if(cnt[0]>cnt[1]) cout <<"happy"; | |
| else cout <<"sad"; | |
| return 0; | |
| } | 
'알고리즘 문제 풀이 > 1DP_과제(~180615)' 카테고리의 다른 글
| 180608_1076_저항 (0) | 2018.06.08 | 
|---|---|
| 180607_5597_과제안내신분? (0) | 2018.06.07 | 
| 180602_4690_완전 세제곱 (0) | 2018.06.02 | 
| 180601_1934_최소공배수 (0) | 2018.06.01 | 
| 180529_11586_지영 공주님의 마법 거울 (0) | 2018.05.29 |