A Famous Music composer time limit:MS | Memory limit:65535 KB Difficulty:1
-
-
Describe
-
Mr. B is a famous music composer. One of his most famous work is his set of preludes. These pieces span the musical keys (there is musically distinct the scale notes, and all may use major or minor ton ality). The distinct scale notes is:
| a |
a#=bb |
B |
&N Bsp C |
c#=db |
D |
d#=eb |
E |
F ; |
f#=gb |
g /td> |
g#=ab |
five of the notes has a alternate names, as is indicated above with equals sign. Thus, there is possible names of scale notes, but only 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 possible keys, of which is musically distinct. in naming his preludes, Mr. B used all the keys Exce PT the following, 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 |
Write A program this, given the name of a key, give an alternate name if it have one, or report the key name is unique.
-
Input
-
Each test case was described by one line has the format "note tonality", where "note" is one of the names for the SCA Le notes given above, and "tonality" are either "major" or "minor" (quotes for clarify).
-
Output
-
For each case output the required answer, following the format of the sample.
-
Sample input
-
Ab minord# majorg Minor
-
Sample output
-
Case 1:g# minorcase 2:eb majorcase 3:unique
Let me tell you why you wa:
printf ("Case%d:", sign++);
"Case 1:" There is a space after the colon.
1#include <stdio.h>2#include <string.h>3 intMain ()4 {5 Chars1[Ten],s2[Ten];6 intSign =1;7 while(SCANF ("%s%s", s1,s2)! =EOF)8 { 9printf"Case %d:", sign++);Ten if(!STRCMP (S1,"a#")) printf ("%s%s\n","Bb", S2); One Else if(!STRCMP (S1,"Bb")) printf ("%s%s\n","a#", S2); A Else if(!STRCMP (S1,"C #")) printf ("%s%s\n","Db", S2); - Else if(!STRCMP (S1,"Db")) printf ("%s%s\n","C #", S2); - Else if(!STRCMP (S1,"d#")) printf ("%s%s\n","Eb", S2); the Else if(!STRCMP (S1,"Eb")) printf ("%s%s\n","d#", S2); - Else if(!STRCMP (S1,"F #")) printf ("%s%s\n","Gb", S2); - Else if(!STRCMP (S1,"Gb")) printf ("%s%s\n","F #", S2); - Else if(!STRCMP (S1,"g#")) printf ("%s%s\n","Ab", S2); + Else if(!STRCMP (S1,"Ab")) printf ("%s%s\n","g#", S2); - Elseprintf"unique\n"); + } A}
Nyoj A Famous Music Composer