25 A Famous Music Composer
来源:互联网 发布:mysql自动断开 编辑:程序博客网 时间:2024/05/21 06:02
A Famous Music Composer
时间限制:1000 ms | 内存限制:65535 KB
难度:1
- 描述
- Mr. B is a famous music composer. One of his most famous work was his set of preludes. These 24 pieces span the 24 musical keys (there are musically distinct 12 scale notes, and each may use major or minor tonality). The 12 distinct scale notes are:A A#=Bb B C C#=DbD D#=Eb E F F#=Gb G G#=AbFive 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# majorA# minor C# major Db minor D# major D# minorGb major Gb minor G# majorWrite a program that, given the name of a key, give an alternate name if it has one, or report the key name is unique.
- 输入
- Each test case is described by one line having the format "note tonality", where "note" is one of the 17 names for the scale notes given above, and "tonality" is either "major" or "minor" (quotes for clarify).
- 输出
- For each case output the required answer, following the format of the sample.
- 样例输入
Ab minorD# majorG minor
- 样例输出
Case 1: G# minorCase 2: Eb majorCase 3: UNIQUE
#include<iostream>#include<cstdio>#include<cstring>using namespace std;int main(){ char s[10]; int n=0; while(gets(s)) { printf("Case %d: ",++n); if(s[0]=='A' && s[1]=='#') { s[0]='B'; s[1]='b'; printf("%s\n",s); continue; } if(s[0]=='B' && s[1]=='b') { s[0]='A'; s[1]='#'; printf("%s\n",s); continue; } if(s[0]=='C' && s[1]=='#') { s[0]='D'; s[1]='b'; printf("%s\n",s); continue; } if(s[0]=='D' && s[1]=='b') { s[0]='C'; s[1]='#'; printf("%s\n",s); continue; } if(s[0]=='D' && s[1]=='#') { s[0]='E'; s[1]='b'; printf("%s\n",s); continue; } if(s[0]=='E' && s[1]=='b') { s[0]='D'; s[1]='#'; printf("%s\n",s); continue; } if(s[0]=='F' && s[1]=='#') { s[0]='G'; s[1]='b'; printf("%s\n",s); continue; } if(s[0]=='G' && s[1]=='b') { s[0]='F'; s[1]='#'; printf("%s\n",s); continue; } if(s[0]=='G' && s[1]=='#') { s[0]='A'; s[1]='b'; printf("%s\n",s); continue; } if(s[0]=='A' && s[1]=='b') { s[0]='G'; s[1]='#'; printf("%s\n",s); continue; } printf("UNIQUE\n"); }}
0 0
- 25 A Famous Music Composer
- 25 A Famous Music Composer
- A Famous Music Composer
- A famous music composer
- A Famous Music Composer
- A Famous Music Composer
- A Famous Music Composer
- A Famous Music Composer
- A Famous Music Composer
- A Famous Music Composer
- A Famous Music Composer
- NYOJ 25 A Famous Music Composer
- NYOJ 题目25 A Famous Music Composer
- NYOJ A Famous Music Composer 25
- nyoj 25 A Famous Music Composer
- nyoj 25 A Famous Music Composer
- NYOJ --25--A Famous Music Composer
- 【NYOJ】[25]A Famous Music Composer
- Objective-C研究之词典对象学习(八)
- 获取鼠标点击兼容实现
- fork子进程时和父进程之间的文件描述符的问题
- Openstack前传八(KVM高级特性)
- 心在下雨
- 25 A Famous Music Composer
- probe如何被调用
- 燃烧的下午
- UIWebView 获取内容高度
- 关于flask-wtf和WTForms的测试
- android 面试准备1
- maven-dependency-plugin (goals "copy-dependencies","unpack") is not supported by m2e
- 26 孪生素数问题
- FPGA机器学习之龙星计划机器学习第三堂