【英文】
Problem DescriptionThe Fool is numbered 0 – the number of unlimited potential –and therefore does not have a specific place in the sequence of the Tarot cards. The Fool can be placed either at the beginning of the Major Arcana or at the end. The Major Arcana is often considered as the Fool’s journey through life and as such, he is
ever present and therefore needs no number.
Given n ∈ N+
∑i=1Nni
where [x] = max a (a∈Z,a≤x)
Input :The first line of the input contains one integer TT
Tn109
Output : For each testcase, print a single line starting with “Case ii
Sample Input
3
1
10000
100000000
Sample Output
Case 1: odd
Case 2: even
Case 3: even
【中文】
问题描述傻瓜编号为0 - 无限潜力的数量 - 因此在塔罗牌的序列中没有特定的位置。傻瓜既可以放在Major Arcana的开头,也可以放在最后。Major Arcana通常被认为是愚人的人生旅程,因此,他永远存在,因此不需要任何数字。
给定n∈ñ+
Σi = 1ññ一世
其中[x] = MAX一个(a∈ Ž,a≤x)
输入
输入的第一行包含一个整数 ŤŤ ,Ťñ109
输出
对于每个测试用例,打印以“ Case ”开头的单行 一世一世 //
//
//
//
/ 找规律
【 1,2,3】开方取整 1–odd;
【4,5,6,7,8】开方取整2–even
【9,10,11,12,13,14,15】开方取整 3–odd;
【16,17,18,19,20,21,22,23,24】开方取整 4–even;
依次类推!!!!!
代码如下!!!!!
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
for(int j=1; j<=T; j++)
{
long long num;
cin>>num;
long long sum=0;
sum=sqrt(num);
cout<<"Case "<<j<<": ";
if(sum%2==0)
cout<<"even"<<endl;
else
cout<<"odd"<<endl;
}
return 0;
}
感谢阅读!!!