遇到Hajj就輸出Hajj-e-Akbar,遇到Umrah就輸出Hajj-e-Asghar即可。
C++(0.000)
/*******************************************************/
/* UVa 12577 Hajj-e-Akbar */
/* Author: Maplewing [at] knightzone.studio */
/* Version: 2015/12/01 */
/*******************************************************/
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int casenumber = 0;
string input;
while( cin >> input && input != "*" ){
if( input == "Hajj" ){
printf("Case %d: Hajj-e-Akbar\n", ++casenumber );
}
else if( input == "Umrah" ){
printf("Case %d: Hajj-e-Asghar\n", ++casenumber);
}
}
return 0;
}