#33307: 浪費時間的水題


alex950301 (alex0301)

學校 : 新北市立新莊高級中學
編號 : 141423
來源 : [49.159.246.211]
最後登入時間 :
2024-10-19 20:13:44
e700. 星座 -- 트와이스 | From: [61.64.1.159] | 發表日期 : 2022-12-21 23:56

#include <iostream>
using namespace std ;
int main() {
    string a ;
    while( cin >> a ) {
        int pos = a.find('/') ;
        int front = stoi(a.substr(0,pos)) ;
        int back = stoi(a.substr(pos+1,a.size())) ;
        if( front == 1 && back >= 21 || front == 2 && back <= 19 ) cout << "水瓶座" << endl ;
        else if( front == 2 && back >= 20 || front == 3 && back <= 20 ) cout << "雙魚座" << endl ;
        else if( front == 3 && back >= 21 || front == 4 && back <= 20 ) cout << "牡羊座" << endl ;
        else if( front == 4 && back >= 21 || front == 5 && back <= 21 ) cout << "金牛座" << endl ;
        else if( front == 5 && back >= 22 || front == 6 && back <= 21 ) cout << "雙子座" << endl ;
        else if( front == 6 && back >= 22 || front == 7 && back <= 22 ) cout << "巨蟹座" << endl ;
        else if( front == 7 && back >= 23 || front == 8 && back <= 21 ) cout << "獅子座" << endl ;
        else if( front == 8 && back >= 22 || front == 9 && back <= 23 ) cout << "處女座" << endl ;
        else if( front == 9 && back >= 24 || front == 10 && back <= 23 ) cout << "天秤座" << endl ;
        else if( front == 10 && back >= 24 || front == 11 && back <= 22 ) cout << "天蠍座" << endl ;
        else if( front == 11 && back >= 23 || front == 12 && back <= 22 ) cout << "射手座" << endl ;
        else cout << "摩羯座" << endl ;
    }
    return 0 ;
}

 
ZeroJudge Forum