A Famous Music composer time limit: +Ms | Memory Limit:65535KB 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 are:
A |
A#=bb |
B |
C |
C#=db |
D |
D#=eb |
E |
F |
F#=gb |
G |
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 T He scale 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
-
-
Source
-
-
HDU
-
-
Uploaded by
Li Rubing
#include <stdio.h> #include <string.h>int main () {char a[10],s[10];//array open up, otherwise it won't go too much! Essay int Kase=1;while (scanf ("%s%s", a,s)!=eof) {printf ("Case%d:", kase++), if (!strcmp (A, "a#")) printf ("Bb%s\n", s); else if ( !STRCMP (A, "Bb")) printf ("a#%s\n", s), else if (!strcmp (A, "C #")) printf ("Db%s\n", s), else if (!strcmp (A, "Db")) printf ("C # %s\n ", s), else if (!strcmp (A," d# ")) printf (" Eb%s\n ", s), else if (!strcmp (A," Eb ")) printf (" d#%s\n ", s); else if (!strcmp (A, "F #")) printf ("Gb%s\n", s), else if (!strcmp (A, "Gb")) printf ("F #%s\n", s), and else if (!strcmp (A, "g#")) printf ("Ab%s\n", s); else if (!strcmp (A, "Ab")) printf ("g#%s\n", s), Else printf ("unique\n");} return 0;}
A Famous Music Composer (Nanyang Oj25) (a boring English problem)