题目链接:https://atcoder.jp/contests/arc116/tasks/arc116_a
My Answer Code:
/*
Author:Albert Tesla Wizard
Time:2021/4/9 15:38
*/
#include<bits/stdc++.h>
using namespace std;
using ull=unsigned long long;
void solve(ull n)
{
if(n%2==1)cout<<"Odd"<<'\n';
else
{
if(n%2==0)
{
if(n%4==0)cout<<"Even"<<'\n';
else cout<<"Same"<<'\n';
}
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin>>t;
while(t--)
{
ull n;
cin>>n;
solve(n);
}
return 0;
}
本文提供了一个AtCoder竞赛中ARC116A题目的C++解决方案。通过判断输入数字的奇偶性和是否能被4整除,输出不同结果。代码采用标准模板库,实现了简洁高效的逻辑处理。
142





