FZU 2146

Easy Game

Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u

Submit Status Practice FZU 2146

Description

Fat brother and Maze are playing a kind of special (hentai) game on a string S. Now they would like to count the length of this string. But as both Fat brother and Maze are programmers, they can recognize only two numbers 0 and 1. So instead of judging the length of this string, they decide to judge weather this number is even.

Input

The first line of the date is an integer T, which is the number of the text cases.

Then T cases follow, each case contains a line describe the string S in the treasure map. Not that S only contains lower case letters.

1 <= T <= 100, the length of the string is less than 10086

Output

For each case, output the case number first, and then output “Odd” if the length of S is odd, otherwise just output “Even”.

Sample Input

4 well thisisthesimplest problem inthiscontest

Sample Output

Case 1: Even Case 2: Odd Case 3: Odd Case 4: Odd

 1 #include <stdio.h>
 2 #include <string.h>
 3 int main()
 4 {
 5     int T;
 6     char s[20088];
 7     int i,j,k,ca=1;
 8     scanf("%d",&T);
 9     while(T--)
10     {
11         scanf("%s",s);
12         int l=strlen(s);
13         printf("Case %d: ",ca);
14         if(l%2==0)
15             printf("Even\n");
16         else
17             printf("Odd\n");
18         ca++;
19     }
20     return 0;
21 }

时间: 2024-10-11 16:20:05

FZU 2146的相关文章

Problem 2146 Easy Game (FZU 数学啊)

题目链接:http://acm.fzu.edu.cn/problem.php?pid=2146 Problem Description Fat brother and Maze are playing a kind of special (hentai) game on a string S. Now they would like to count the length of this string. But as both Fat brother and Maze are programme

FZU 2150 Fire Game(点火游戏)

p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-size: 10.5000pt } h2 { margin-top: 5.0000pt; margin-bottom: 5.0000pt; text-align: left; font-family: 宋体; font-weight: bold; font-size: 18.0000pt } h3 {

FZU 1096 QS Network

QS Network Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on FZU. Original ID: 1096 64-bit integer IO format: %I64d      Java class name: Main In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS.

FZU 1759 欧拉函数 降幂公式

Description Given A,B,C, You should quickly calculate the result of A^B mod C. (1<=A,C<=1000000000,1<=B<=10^1000000). Input There are multiply testcases. Each testcase, there is one line contains three integers A, B and C, separated by a singl

ACM: FZU 2150 Fire Game - DFS+BFS+枝剪 或者 纯BFS+枝剪

FZU 2150 Fire Game Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Description Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this boar

FZU 2112 并查集、欧拉通路

原题:http://acm.fzu.edu.cn/problem.php?pid=2112 首先是,票上没有提到的点是不需要去的. 然后我们先考虑这个图有几个联通分量,我们可以用一个并查集来维护,假设有n个联通分量,我们就需要n-1条边把他们连起来. 最后对于每个联通分量来说,我们要使它能一次走完,就是要求他是否满足欧拉通路,也就是这个联通分量中至多有2个度为奇数的点,每多出2个度为奇数的点,就多需要一条边(因为单个连通分量的所有点的度数之和为偶数,所以不可能存在奇数个奇数度数的点). 1 #i

FZU Problem 2102 Solve equation (数学啊 )

题目链接:http://acm.fzu.edu.cn/problem.php?pid=2102 Problem Description You are given two positive integers A and B in Base C. For the equation: A=k*B+d We know there always existing many non-negative pairs (k, d) that satisfy the equation above. Now in

FZU Problem 2104 Floor problem (数学啊 )

题目链接:http://acm.fzu.edu.cn/problem.php?pid=2104 Problem Description In this problem, we have f(n,x)=Floor[n/x]. Here Floor[x] is the biggest integer such that no larger than x. For example, Floor[1.1]=Floor[1.9]=1, Floor[2.0]=2. You are given 3 posit

FZU 2105 Digits Count(按位维护线段树)

[题目链接] http://acm.fzu.edu.cn/problem.php?pid=2105 [题目大意] 给出一个序列,数字均小于16,为正数,每次区间操作可以使得 1. [l,r]区间and一个数 2. [l,r]区间or一个数 3. [l,r]区间xor一个数 4. [l,r]区间查询和 操作数均为小于16的非负整数 [题解] 由于操作数很小,因此我们可以按位维护四棵线段树,表示二进制中的第i位, 对于and操作,只有当and的当前位为0时才对区间有影响,效果是将区间全部变为0, 对