Title Link: http://acm.fzu.edu.cn/problem.php?pid=2146
Problem Description
Fat brother and Maze is playing a kind of special (hentai) game on a string S. Now they would as to count the length of this string. But as both Fat brother and Maze is programmers, they can recognize only the 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 a integer T, which is the number of the text cases.
Then T cases follow contains a line describe the string S in the treasure map. Not this S only contains lower case letters.
1 <= T <=, 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 Input4wellthisisthesimplestprobleminthiscontest Sample Outputcase 1:evencase 2:oddcase 3:oddcase 4:odd
The code is as follows:
#include <cstdio> #include <cstring>int main () { char s[10087]; int cas = 0; int t; scanf ("%d", &t); while (t--) { scanf ("%s", s); int Len=strlen (s); printf ("Case%d:", ++cas); if (len%2) printf ("odd\n"); else printf ("even\n"); } return 0;}
Problem 2146 Easy Game (Fzu math AH)