fzu 2146 Easy Game
http://acm.fzu.edu.cn/problem.php?pid=2146
Accept: 661 Submit: 915
Time Limit: 1000 mSec Memory Limit : 32768 KB
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
Sample Output
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <iomanip>
#include <vector>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#pragma warning(disable:4786) using namespace std; const int INF = 0x3f3f3f3f;
const int MAX = + ;
const double eps = 1e-;
const double PI = acos(-1.0);
char str[MAX]; int main()
{
int T ;
while(~scanf("%d",&T))
{
int first = ;
getchar();
while(T --)
{
scanf("%s",str);
int len = strlen(str);
printf("Case %d: ", first ++);
if(len % )
printf("Odd\n");
else
printf("Even\n");
}
}
return ;
}
fzu 2146 Easy Game的更多相关文章
- FZU 2146
Easy Game Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit St ...
- fzu 1913 Easy Comparison(字符串)
题目链接:fzu 1913 Easy Comparison 题目大意:给出一个字符串,计算与它按照字典序排序排列后的字符串有多少个位置不同. 解题思路:水体,sort一下,然后遍历一遍就好. #inc ...
- FZU 2176 easy problem (DFS序+树状数组)
对于一颗树,dfs遍历为每个节点标号,在进入一个树是标号和在遍历完这个树的子树后标号,那么子树所有的标号都在这两个数之间,是一个连续的区间.(好神奇~~~) 这样每次操作一个结点的子树时,在每个点的开 ...
- fzu 1753 Another Easy Problem
本题题意为求 t (t<150) 个 c (n,m) (1<=m<=n<=100000)的最大公因子: 本题的难点为优化.主要有两个优化重点.一是每次对单个素因子进行处理,优 ...
- ACM: FZU 2105 Digits Count - 位运算的线段树【黑科技福利】
FZU 2105 Digits Count Time Limit:10000MS Memory Limit:262144KB 64bit IO Format:%I64d & ...
- FZU 2105 Digits Count(位数计算)
Description 题目描述 Given N integers A={A[0],A[1],...,A[N-1]}. Here we have some operations: Operation ...
- fzu 2105 Digits Count ( 线段树 ) from 第三届福建省大学生程序设计竞赛
http://acm.fzu.edu.cn/problem.php?pid=2105 Problem Description Given N integers A={A[0],A[1],...,A[N ...
- FZU 2108(dfs模拟,大数取余)
K Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Pr ...
- FZU Monthly-201903 tutorial
FZU Monthly-201903 tutorial 题目(难度递增) easy easy-medium medium medium-hard hard 思维难度 ABF G CH D E A. D ...
随机推荐
- php+mysql实现事务回滚
模拟条件:第一个表插入成功,但是第二个表插入失败,回滚.第一个表插入成功,第二个表插入成功,执行.第一个表插入失败,第二个表插入成功,回滚.第一个表插入失败,第二个表插入失败,回滚.以上情况都需要回滚 ...
- Java进程间通信
传统的进程间通信的方式有大致如下几种: (1) 管道(PIPE) (2) 命名管道(FIFO) (3) 信号量(Semphore) (4) 消息队列(MessageQueue) (5) ...
- 【Android测试】【随笔】搜狗、腾讯技术交流会心得
◆版权声明:本文出自胖喵~的博客,转载必须注明出处. 转载请注明出处:http://www.cnblogs.com/by-dream/p/5048525.html 今天没上班,一大早就起来赶去搜狐网络 ...
- Maximal Square || LeetCode
dp. #define MAX 1000 int rowLeft[MAX][MAX]; int colUp[MAX][MAX]; int dp[MAX][MAX]; void calRow(char ...
- [LeetCode] Longest Palindromic Substring(manacher algorithm)
Given a string S, find the longest palindromic substring in S. You may assume that the maximum lengt ...
- iOS获取设备型号、设备类型等信息
摘自 :http://www.mamicode.com/info-detail-1165460.html 设备标识 关于设备标识,历史上盛行过很多英雄,比如UDID.Mac地址.OpenUDID等,然 ...
- jQuery控制CSS样式
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- JS之Array.slice()方法
1.Array.slice(startIndex,endIndex); 返回由原始数组从startIndex到endIndex-1的元素构成的新数组; startIndex:默认值0,如果startI ...
- SQL Server 2008 R2不支持limit(限制行数)
SQL Server 2008 R2不支持limit 可用:select top 3 * from Websites2 MySQL 语法 SELECT *FROM PersonsLIMIT 5; Or ...
- PySe-002-Py-简单示例及编码设定
非常简单而又国际化的例子 Hello World!在控制台依次输入命令:python, print "This is first program %s" % "Hello ...