标签:
A | A#=Bb | B | C | C#=Db | D | D#=Eb | E | F | F#=Gb | G | G#=Ab |
Ab minor | A# major | A# minor | C# major | Db minor |
D# major | D# minor | Gb major | Gb minor | G# major |
Ab minor D# major G minor
Case 1: G# minor Case 2: Eb major Case 3: UNIQUE
让我告诉你你WA的原因:
printf("Case %d: ",sign++);
"Case 1: "冒号后面还有个空格。
1 #include <stdio.h> 2 #include <string.h> 3 int main() 4 { 5 char s1[10],s2[10]; 6 int sign = 1; 7 while(scanf("%s%s",s1,s2) != EOF) 8 { 9 printf("Case %d: ",sign++); 10 if(!strcmp(s1,"A#")) printf("%s %s\n","Bb",s2); 11 else if(!strcmp(s1,"Bb")) printf("%s %s\n","A#",s2); 12 else if(!strcmp(s1,"C#")) printf("%s %s\n","Db",s2); 13 else if(!strcmp(s1,"Db")) printf("%s %s\n","C#",s2); 14 else if(!strcmp(s1,"D#")) printf("%s %s\n","Eb",s2); 15 else if(!strcmp(s1,"Eb")) printf("%s %s\n","D#",s2); 16 else if(!strcmp(s1,"F#")) printf("%s %s\n","Gb",s2); 17 else if(!strcmp(s1,"Gb")) printf("%s %s\n","F#",s2); 18 else if(!strcmp(s1,"G#")) printf("%s %s\n","Ab",s2); 19 else if(!strcmp(s1,"Ab")) printf("%s %s\n","G#",s2); 20 else printf("UNIQUE\n"); 21 } 22 }
NYOJ 25 A Famous Music Composer
标签:
原文地址:http://www.cnblogs.com/ljwTiey/p/4305140.html