Easy Game
来源:互联网 发布:烟雾视频软件 编辑:程序博客网 时间:2024/05/16 12:35
Think:
确实是很 EASY 的签到题。。。。
判断字符串长度 是奇数或者偶数 然后输出就好了
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<stdio.h>#include<string.h>int main(){ char str[123456]; int d; int T; int kase = 0; while(~scanf("%d",&T)) { while(T --) { scanf("%s", str); d = strlen(str); printf("Case %d: ", ++ kase); if (d % 2 == 0) printf("Even\n"); else printf("Odd\n"); memset(str, 0, sizeof(str)); } }}
- Easy Game
- Easy Game
- C - Easy Game
- lightoj 1031 - Easy Game
- ZOJ_3791_An Easy Game(DP)
- FZU 2146 Easy Game
- FZU2146 Easy Game
- lightoj 1031 - Easy Game
- FZU-2146 Easy Game
- LightOJ 1031-Easy Game
- FZU 2146 Easy Game
- 292. Nim Game #Easy
- FZU Easy Game
- [Easy] Nim Game
- Lightoj 1031 - Easy Game DP
- zoj3791(An Easy Game) DP
- ZOJ 3791 An Easy Game
- ZOJ 3791 An Easy Game
- JavaScript 函数 preventDefault()
- ARM Linux 3.x的设备树(Device Tree)
- Linux 命令-文件管理命令
- 安卓音乐播放器,简单,开源
- javascript的window.ActiveXObject对象,区别浏览器的方法
- Easy Game
- linux下gpasswd命令
- MFC自定义消息
- 354. Russian Doll Envelopes
- B
- AVL树与红黑树比较
- win7使用apache2作文件服务器
- 希尔排序 Java实现
- 从今以往 勿复相思