FZU 2146 Easy Game

原创 2018年04月15日 22:09:17

Problem 2146 Easy Game

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 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

题解代码

#include <iostream>
#include <cstring>
using namespace std;
int main(){
    int n;
    cin >> n;
    char a[11000];
    for(int i = 1; i <= n; i++){
        scanf("%s",a);
        int len = strlen(a);
        if(len%2==0){
            printf("Case %d: Even\n",i);
        }
        else{
            printf("Case %d: Odd\n",i);
        }
    }
    return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/AcmAres/article/details/79954147

FZU-2146 Easy Game

#include #include #include #include using namespace std;int t, cas; string str;int main() { c...
  • somniloquy_
  • somniloquy_
  • 2015-08-23 18:08:14
  • 215

A Easy Game(FZU 2146)

A Easy Game Fat brother and Maze are playing a kind of special (hentai) game on a string S. Now t...
  • chimchim04
  • chimchim04
  • 2017-11-25 20:07:39
  • 943

FZU Problem 2146 Easy Game ( 数学啊)

FZU Problem 2146 Easy Game ( 数学啊)
  • u012860063
  • u012860063
  • 2014-12-03 18:26:16
  • 937

fzu 2150 Fire Game 【技巧BFS】

题目: fzu 2141 Sub-Bipartite Graph (贪心)
  • y990041769
  • y990041769
  • 2014-11-20 11:16:33
  • 3970

FZU2268 Cutting Game(数学,规律)(第七届福建省大学生程序设计竞赛)

题目: Problem 2268 Cutting Game Accept: 10    Submit: 12 Time Limit: 1000 mSec    Memory Limi...
  • riba2534
  • riba2534
  • 2017-07-18 21:47:34
  • 550

FZU - 2150 Fire Game(两点bfs)

Problem 2150 Fire Game Accept: 623    Submit: 2445 Time Limit: 1000 mSec    Memory Limit : 32768 KB...
  • qq_18738333
  • qq_18738333
  • 2015-04-13 23:58:35
  • 1151

FZU-Problem 2146 Easy Game

Problem 2146 Easy Game Accept: 429    Submit: 595 Time Limit: 1000 mSec    Memory Limit : 32768 ...
  • u012773338
  • u012773338
  • 2014-08-02 10:51:32
  • 529

FZU2264,2265,2266 Card Game 系列 (数学,规律)(第七届福建省大学生程序设计竞赛)

题目: Problem 2264 Card Game (First Edition) Accept: 5    Submit: 17 Time Limit: 1000 mSec    Memor...
  • riba2534
  • riba2534
  • 2017-07-18 22:16:58
  • 751

fzu 2144 Shooting Game 区间覆盖贪心

题意:一个人在空间直角坐标系的原点,即是(0,0,0), 他的射程范围是以R为半径的球体,有n只蚊子,每只蚊子都会有原始坐标和三个坐标方向的速度,人要尽量把多的蚊子射下来,并且开枪次数最少。 ...
  • wyt734933289
  • wyt734933289
  • 2016-07-22 09:33:04
  • 367

fzu2265Card Game (Second Edition) (数学)(简单)

b 从小到大排序, a对应有n!中排列,其中a[i]对于某个b[j]是有(n-1)!都是对应的(因为a[i]只能对应n个b中),而a[i]对应b[j]的值是一定的,可以直接计算出每个a[i]在这n!中...
  • mosquito_zm
  • mosquito_zm
  • 2017-07-20 11:25:26
  • 170
收藏助手
不良信息举报
您举报文章:FZU 2146 Easy Game
举报原因:
原因补充:

(最多只允许输入30个字)