Five of the notes have two alternate names, as is indicated above with equals sign. Thus, there are 17 possible names of scale notes, but only 12 musically distinct notes. When using one of these as the keynote for a musical key, we can further distinguish between major and minor tonalities. This gives 34 possible keys, of which 24 are musically distinct.
In naming his preludes, Mr. B used all the keys except the following 10, which were named instead by their alternate names:
Ab minor |
A# major |
A# minor |
C# major |
Db minor |
D# major |
D# minor |
Gb major |
Gb minor |
G# major |
1 #include <stdio.h> //这道题开始作的时候是错的,可是从新作了一次又对了,真是郁闷,不知道错在哪里,其实这是一道很是简单的水题来的。。。
2 #include <string.h>
3
4 int main(){
5 char s1[10];
6 char s2[10];
7 int time;
8
9 time=1;
10
11 while(scanf("%s%s",s1,s2)!=EOF){
12 printf("Case %d: ",time);
13 time++;
14
15 if(strcmp(s1,"A#")==0)
16 printf("%s %s\n","Bb",s2);
17
18 else if(strcmp(s1,"Bb")==0)
19 printf("%s %s\n","A#",s2);
20
21 else if(strcmp(s1,"C#")==0)
22 printf("%s %s\n","Db",s2);
23
24 else if(strcmp(s1,"Db")==0)
25 printf("%s %s\n","C#",s2);
26
27 else if(strcmp(s1,"D#")==0)
28 printf("%s %s\n","Eb",s2);
29
30 else if(strcmp(s1,"Eb")==0)
31 printf("%s %s\n","D#",s2);
32
33 else if(strcmp(s1,"F#")==0)
34 printf("%s %s\n","Gb",s2);
35
36 else if(strcmp(s1,"Gb")==0)
37 printf("%s %s\n","F#",s2);
38
39 else if(strcmp(s1,"G#")==0)
40 printf("%s %s\n","Ab",s2);
41
42 else if(strcmp(s1,"Ab")==0)
43 printf("%s %s\n","G#",s2);
44
45 else
46 printf("UNIQUE\n");
47 }
48 return 0;
49 }