竞赛讨论区 > 想问一下大佬们,c题我这样写为什么过不了
头像
wxwnnzdyd
发布于 02-04 17:19
+ 关注

想问一下大佬们,c题我这样写为什么过不了

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(),v.end()
#define endl '\n'
#define pii pair<int,int>
#define mp make_pair
#define int long long
const int MOD = 1e9 + 7;

vector<string> shengxiao{"Rat","Ox","Tiger","Rabbit","Dragon","Snake","Horse","Goat","Monkey","Rooster","Dog","Pig"};


void solve()
{
    int n;
    cin>>n;
    int now=4;
    if(n>0) now=(now+n)%12;
    else now=(now+n+12)%12;
    cout<<shengxiao[now]<<endl;
}

signed main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
   
    return 0;
}

}

全部评论

(1) 回帖
加载中...
话题 回帖

等你来战

查看全部

热门推荐