1 /* 2 描述 3 Mr. B, Mr. G and Mr. M are now in Warsaw, Poland, for the 2012’s ACM-ICPC World Finals Contest. 4 They’ve decided to take a 5 hours training every day before the contest. Also, 5 they plan to start training at 10:00 each day since the World Final Contest will do so. 6 The scenery in Warsaw is so attractive that Mr. B would always like to take a walk outside for a while after breakfast. 7 However, Mr. B have to go back before training starts, otherwise his teammates will be annoyed. Here is a problem: 8 Mr. B does not have a watch. In order to know the exact time, he has bought a new watch in Warsaw, 9 but all the numbers on that watch are represented in Roman Numerals. Mr. B cannot understand such kind of numbers. 10 Can you translate for him?11 输入12 Each test case contains a single line indicating a Roman Numerals that to be translated. All the numbers can be found on clocks. 13 That is, each number in the input represents an integer between 1 and 12. Roman Numerals are expressed by strings consisting of uppercase ‘I’,14 ‘V’ and ‘X’. See the sample input for further information.15 输出16 For each test case, display a single line containing a decimal number corresponding to the given Roman Numerals.17 样例输入18 I19 II20 III21 IV22 V23 VI24 VII25 VIII26 IX27 X28 XI29 XII30 样例输出31 Case 1: 132 Case 2: 233 Case 3: 334 Case 4: 435 Case 5: 536 Case 6: 637 Case 7: 738 Case 8: 839 Case 9: 940 Case 10: 1041 Case 11: 1142 Case 12: 1243 */44 #include45 #include 46 int main()47 {48 char s[12][10]={ "I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"},c[10];49 int i, j=1;50 while(scanf("%s",c) != EOF)51 {52 for(i = 0; i<12; i++)53 if(strcmp(c,s[i])==0)//将c与没行测试数据进行比较 54 printf("Case %d: %d\n",j++,++i);55 }56 return 0;57 }