The Famous Clock

简介:

The Famous Clock

时间限制: 1000 ms  |  内存限制: 65535 KB
难度: 1
描述

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

查看代码---运行号:252406----结果:Accepted

运行时间: 2012-10-05 19:47:00  |  运行人: huangyibiao
01. #include <string>
02. #include <iostream>
03. usingnamespace std;
04.  
05. intmain()
06. {
07. string s;
08. intcount = 0;
09. while(cin >> s)
10. {
11. cout <<"Case " << ++count  << ": ";
12. if(s == "I")
13. cout <<"1\n";
14. elseif (s == "II")
15. cout <<"2\n";
16. elseif (s == "III")
17. cout <<"3\n";
18. elseif (s == "IV")
19. cout <<"4\n";
20. elseif (s == "V")
21. cout <<"5\n";
22. elseif (s == "VI")
23. cout <<"6\n";
24. elseif (s == "VII")
25. cout <<"7\n";
26. elseif (s == "VIII")
27. cout <<"8\n";
28. elseif (s == "IX")
29. cout <<"9\n";
30. elseif (s == "X")
31. cout <<"10\n";
32. elseif (s == "XI")
33. cout <<"11\n";
34. elseif (s == "XII")
35. cout <<"12\n";
36. }
37. return0;
38. }

目录
相关文章
|
机器学习/深度学习 监控 Ubuntu
perf性能分析工具使用分享
perf性能分析工具使用分享
2649 0
perf性能分析工具使用分享
|
机器学习/深度学习 人工智能 达摩院
阿里云开发者社区 x 达摩院 x计算平台事业部 大数据 + AI向量检索专场Meetup回顾(内含讲师PPT领取)
阿里云开发者社区 x 达摩院 x计算平台事业部 大数据 + AI向量检索专场。来自,阿里巴巴、爱奇艺、Zilliz、搜狐、Jina.AI等公司的九位重量级讲师在现场分享了他们前沿的向量检索技术思考与实践沉淀总结,快来领取讲师精彩ppt!
1886 0
阿里云开发者社区 x 达摩院 x计算平台事业部 大数据 + AI向量检索专场Meetup回顾(内含讲师PPT领取)
|
数据采集 存储 自然语言处理
快速构建企业智能门户,销售额倍增,人才触手可及 - 爬虫 + RAG + LLM
本文介绍了一款基于大模型的智能企业门户接待系统,旨在通过先进的AI技术,实现企业网站信息的自动化处理与响应,提高客户支持、产品推荐和人才招聘的效率。系统利用爬虫技术自动提取公司官网信息,结合语音识别、大模型生成等技术,支持语音和文本输入,通过RAG(检索增强生成)方式生成精准回答,并支持语音播报,提供类似真人的接待体验。项目涵盖了环境准备、数据构建、代码实现、测试调优、部署等多个阶段,详细记录了开发过程中遇到的问题及解决方案,展示了系统在咨询公司信息、产品询问及招聘岗位咨询等场景下的应用潜力。未来计划在数据类型支持、会话记忆、并发处理、语音合成等方面进一步优化,以提升用户体验和服务质量。
329 0
|
前端开发 Java 数据库连接
MVC模式和三层架构-登录注册增删改查案例-(详细案例)
MVC模式和三层架构-登录注册增删改查案例-(详细案例)
MVC模式和三层架构-登录注册增删改查案例-(详细案例)
|
Web App开发 Android开发 iOS开发
Charles浏览器抓包配置
Chrome 和 Firefox 浏览器默认并不使用系统的代理服务器设置,而 Charles 是通过将自己设置成代理服务器来完成封包截取的,所以在默认情况下无法截取 Chrome 和 Firefox 浏览器的网络通讯内容,需要打开系统代理设置。 Ie浏览器和360浏览器,默认使用windows代理,可以直接进行抓包
804 0
Charles浏览器抓包配置
|
Go 数据库
Go --- 一个根据IP查询地址的包geoip2
Go --- 一个根据IP查询地址的包geoip2
Go --- 一个根据IP查询地址的包geoip2
|
存储 SQL 分布式计算
MaxCompute(原名ODPS,全称Open Data Processing Service)
MaxCompute(原名ODPS,全称Open Data Processing Service)是阿里云开发的一种云原生数据处理和分析服务。它提供了强大的数据计算和处理能力,支持海量数据的存储、计算、分析和挖掘,并且具有高可靠、高性能、高可扩展、高安全等优势,适用于各种数据处理和分析场景。
1819 0
|
存储 运维 Cloud Native
阿里云李飞飞:什么是云原生数据库
云原生是一种新型技术体系,是云计算未来的发展方向。今天,阿里云李飞飞将和我们分享何为云原生、云原生如何与分布式有机结合,以及云原生技术如何帮助客户迈入数字原生时代。
阿里云李飞飞:什么是云原生数据库
|
存储 专有云 对象存储
钉钉专属存储部署流程
七步部署钉钉专属存储
2254 0
钉钉专属存储部署流程
融合趋势下基于 Flink Kylin Hudi 湖仓一体的大数据生态体系
本文由 T3 出行大数据平台负责人杨华和资深大数据平台开发工程师王祥虎介绍 Flink、Kylin 和 Hudi 湖仓一体的大数据生态体系以及在 T3 的相关应用场景。
融合趋势下基于 Flink Kylin Hudi 湖仓一体的大数据生态体系