描述

Mr. B, Mr. G and Mr. M are now in Warsaw, Poland, for the 2012’s ACM-ICPC World Finals Contest. They’ve decided to take a 5 hours training every day before the contest. Also, they plan to start training at 10:00 each day since the World Final Contest will do so. The scenery in Warsaw is so attractive that Mr. B would always like to take a walk outside for a while after breakfast. However, Mr. B have to go back before training starts, otherwise his teammates will be annoyed. Here is a problem: Mr. B does not have a watch. In order to know the exact time, he has bought a new watch in Warsaw, but all the numbers on that watch are represented in Roman Numerals. Mr. B cannot understand such kind of numbers. Can you translate for him?

输入
Each test case contains a single line indicating a Roman Numerals that to be translated. All the numbers can be found on clocks. That is, each number in the input represents an integer between 1 and 12. Roman Numerals are expressed by strings consisting of uppercase ‘I’, ‘V’ and ‘X’. See the sample input for further information.
输出
For each test case, display a single line containing a decimal number corresponding to the given Roman Numerals.
样例输入
I
II
III
IV
V
VI
VII
VIII
IX
X
XI
XII
样例输出
Case 1: 1
Case 2: 2
Case 3: 3
Case 4: 4
Case 5: 5
Case 6: 6
Case 7: 7
Case 8: 8
Case 9: 9
Case 10: 10
Case 11: 11
Case 12: 12
 #include <stdio.h>
#include <string.h> int main(){
char s[];
int number;
int time; time=; while(scanf("%s",&s)!=EOF){
if(strcmp(s,"I")==)
number=; else if(strcmp(s,"II")==)
number=; else if(strcmp(s,"III")==)
number=; else if(strcmp(s,"IV")==)
number=; else if(strcmp(s,"V")==)
number=; else if(strcmp(s,"VI")==)
number=; else if(strcmp(s,"VII")==)
number=; else if(strcmp(s,"VIII")==)
number=; else if(strcmp(s,"IX")==)
number=; else if(strcmp(s,"X")==)
number=; else if(strcmp(s,"XI")==)
number=; else if(strcmp(s,"XII")==)
number=; printf("Case %d: ",time);
time++;
printf("%d\n",number);
}
return ;
}
 

The Famous Clock的更多相关文章

  1. ACM The Famous Clock

    The Famous Clock 时间限制:1000 ms  |  内存限制:65535 KB 难度:1   描述 Mr. B, Mr. G and Mr. M are now in Warsaw, ...

  2. HDU 4256 The Famous Clock

    The Famous Clock Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  3. nyoj 484-The Famous Clock

    484-The Famous Clock 内存限制:64MB 时间限制:1000ms 特判: No 通过数:2 提交数:2 难度:1 题目描述: Mr. B, Mr. G and Mr. M are ...

  4. JavaScript美术馆进化史

    内容选自<<JavaScript DOM 编程艺术>>第4-6章,跟着作者一起见证美术馆的进化吧. 先放效果图,然后一步步做出每个效果.每个效果都有它实用的地方,且知道过程可以 ...

  5. 【南阳OJ分类之语言入门】80题题目+AC代码汇总

    小技巧:本文之前由csdn自动生成了一个目录,不必下拉一个一个去找,可通过目录标题直接定位. 本文转载自本人的csdn博客,复制过来的,排版就不弄了,欢迎转载. 声明: 题目部分皆为南阳OJ题目. 代 ...

  6. javascript DOM(2) 一个网页上切换显示不同的图片或文本

    摘自: javascript DOM 编程艺术 1. 在一个网页上切换显示不同的图片 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tran ...

  7. 《DOM Scripting》学习笔记-——第五章、第六章 案列改进

    第四章的案例代码可以得到更好的改进.例如:预留退路.向后兼容性和分离js. 原html代码: <!DOCTYPE html> <html lang="en"> ...

  8. 《DOM Scripting》学习笔记-——第四章 案列分析 JS美术馆(点击链接到图片)

    实现效果:点击图片链接,可以在当前网页显示图片,并且显示图片标题. Html代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN&qu ...

  9. HDU 4256 翻译罗马数字

    参考自:https://www.cnblogs.com/ECJTUACM-873284962/p/6414173.html The Famous Clock Time Limit: 2000/1000 ...

随机推荐

  1. Windows server 2008 上部署 MVC (NopCommerce 3.4)网站

    自己用开源框架做了个商城,该框架是基于mvc4的,本地编译通过,运行一切正常,关于发布遇到了好几个问题. 本地: IIS7.5. VS2013 总结后发现只需要设置两个问题,就不会有那些古怪的问题:什 ...

  2. LeetCode 234 Palindrome Linked List

    Given a singly linked list, determine if it is a palindrome. 思路: 回文结构从后向前遍历与从前向后遍历的结果是相同的,可以利用一个栈的结构 ...

  3. Argument 'xxx' is not a function, got undefined,初学Angular的第一个坑

    终于考完试了,在没更新的这一段时间里,一直都在忙于应付考试.不过在期间也是接触到不少好玩的东西,比如Html5的Canvas,我用lufylegend的Html5引擎做了个<看你有所色>的 ...

  4. 修复Debian(Ubuntu)Grub2 引导

    重装win7, 之前的系统debian 的引导就没有了. 而debian 的盘似乎没有ubuntu的livecd模式,于是用ultraISO将ubuntu的ios文件写入到u盘中. boot时选择启动 ...

  5. 转载 JQuery中attr属性和JQuery.data()学习

    转载原地址: http://www.cnblogs.com/yeminglong/p/5405745.html 用html直接data-key来存放,key必须全部小写. <div data-m ...

  6. POJ 3922A Simple Stone Game

    题目链接 A Sample Stone Game 题目大意:给定n,k,表示最初时有n个石头,两个人玩取石子游戏,第一个人第一次可以取1~n-1个石头,后面每个人最多可以拿走前面一个人拿走的个数的K倍 ...

  7. HDU 3664 Permutation Counting (DP)

    题意:给一个 n,求在 n 的所有排列中,恰好有 k 个数a[i] > i 的个数. 析:很明显是DP,搞了好久才搞出来,觉得自己DP,实在是太low了,思路是这样的. dp[i][j]表示 i ...

  8. iOS开发60分钟入门

    原文:https://github.com/qinjx/30min_guides/blob/master/ios.md 本文面向已有其它语言(如Java,C,PHP,Javascript)编程经验的i ...

  9. CSS 文本格式

    整理自:(http://www.w3school.com.cn/css/css_text.asp) Text Color 颜色属性被用来设置文字的颜色. 颜色是通过CSS最经常的指定: 十六进制值 - ...

  10. 教你50招提升ASP.NET性能(十八):在处理网站性能问题前,首先验证问题是否出在客户端

    (29)Before tackling any website performance issue, first verify the problem isn’t on the client 招数29 ...