没有直接人肉,选择打表了。
#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
using namespace std;
int main(){
int n,t=1;
char a[33];
scanf("%d",&n);getchar();
while(n--){
int ans;
gets(a);
//puts(a);
if(!strcmp(a,"Cleveland Cavaliers")) ans=1;
else if(!strcmp(a,"Golden State Warriors")) ans=2;
else if(!strcmp(a,"San Antonio Spurs")) ans=5;
else if(!strcmp(a,"Miami Heat")) ans=3;
else if(!strcmp(a,"Dallas Mavericks")) ans=1;
else if(!strcmp(a,"L.A. Lakers")) ans=11;
else if(!strcmp(a,"Boston Celtics"))ans=17;
else if(!strcmp(a,"Detroit Pistons"))ans=3;
else if(!strcmp(a,"Chicago Bulls"))ans=6;
else if(!strcmp(a,"Houston Rockets"))ans=2;
else if(!strcmp(a,"Philadelphia 76ers"))ans=2;
else if(!strcmp(a,"Seattle Sonics"))ans=1;
else if(!strcmp(a,"Washington Bullets"))ans=1;
else if(!strcmp(a,"Portland Trail Blazers"))ans=1;
else if(!strcmp(a,"New York Knicks"))ans=2;
else if(!strcmp(a,"Milwaukee Bucks"))ans=1;
else if(!strcmp(a,"St. Louis Hawks"))ans=1;
else if(!strcmp(a,"Syracuse Nats"))ans=1;
else if(!strcmp(a,"Minneapolis Lakers"))ans=5;
else if(!strcmp(a,"Rochester Royals"))ans=1;
else if(!strcmp(a,"Baltimore Bullets"))ans=1;
else if(!strcmp(a,"Philadelphia Warriors")) ans=2;
else ans=0;
printf("Case #%d: %d\n",t++,ans);
}
return 0;
}