zoukankan      html  css  js  c++  java
  • FZU 2146

    Easy 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 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
    ");
    16         else
    17             printf("Odd
    ");
    18         ca++;
    19     }
    20     return 0;
    21 }
    View Code
  • 相关阅读:
    php中的heredoc和nowdoc对比
    PHP官方网站及PHP手册
    php扩展编译方法
    linux下修改时间和时区
    个人觉得非常好用的mysql客户端工具HeidiSQL
    mysql主从复制总结
    mysql优化的21条经验(转)
    mysql存储引擎选择(转)
    show profiles 分析sql耗时瓶颈
    tar命令的使用方法
  • 原文地址:https://www.cnblogs.com/cyd308/p/4771406.html
Copyright © 2011-2022 走看看