A Famous Music Composer(南阳oj25)(一道无聊的英文题)
来源:互联网 发布:利用网络学英语 编辑:程序博客网 时间:2024/06/06 07:08
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
- 来源
- hdu
- 上传者
李如兵
#include<stdio.h>#include<string.h>int main(){char a[10],s[10];//数组开大点,否则不会过!破题。 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);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;}
0 0
- A Famous Music Composer(南阳oj25)(一道无聊的英文题)
- A Famous Music Composer(水一道)
- 南阳题目25-A Famous Music Composer
- 南阳oj 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
- 南阳oj 题目25 A Famous Music Composer
- 南阳 oj 语言入门 A Famous Music Composer
- A Famous Music Composer(map)
- NYOJ - A Famous Music Composer
- 25 A Famous Music Composer
- 笔试题整理
- 云开发日记------junit+mockito单元测试
- c++中vector容器
- [ACM] HDU 1269 迷宫城堡(Tarjan算法求强联通分量)
- CritterAI官方文档翻译【An Introduction to Navigation】
- A Famous Music Composer(南阳oj25)(一道无聊的英文题)
- 东北大学考研线性表相关历年真题题目整理
- 【深度学习笔记】多层感知机,非权值共享型卷积神经网络,权值共享型卷积神经网络之间的关系
- 亲历快速排序算法,有感于程序的边界条件
- Behavior Tree
- 黑马程序员——IO流读取键盘录入以及转换流的用法
- 黑马程序员——IO字节流复制图片以及MP3文件的方法
- CritterAI官方文档翻译【The Navigation Mesh】
- 另一种阶乘问题(南阳oj65)