NYOJ 484 The Famous Clock

#include<stdio.h>
#include<string.h>
int main()
{
  int i,n=0;
  char a[10];
  char str[15][5]={"I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"};
  while(~scanf("%s",a))
  {
    n++;
    for(i=0;i<12;i++)
    {
      if(strcmp(a,str[i])==0)
      {
        printf("Case %d: %d\n",n,i+1);
        break;
      }
    }

  }

}

你可能感兴趣的:(Lock)