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#=Db D       D#=Eb  E       F        F#=Gb  G       G#=Ab
 
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 
Write 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 minor
D# major
G minor
样例输出
Case 1: G# minor
Case 2: Eb major
Case 3: UNIQUE

让我告诉你你WA的原因:

 printf("Case %d: ",sign++);

"Case 1: "冒号后面还有个空格。
 #include <stdio.h>
#include <string.h>
int main()
{
char s1[],s2[];
int sign = ;
while(scanf("%s%s",s1,s2) != EOF)
{
printf("Case %d: ",sign++);
if(!strcmp(s1,"A#")) printf("%s %s\n","Bb",s2);
else if(!strcmp(s1,"Bb")) printf("%s %s\n","A#",s2);
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);
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);
else printf("UNIQUE\n");
}
}

NYOJ 25 A Famous Music Composer的更多相关文章

  1. 25.A Famous Music Composer

    描述 Mr. B is a famous music composer. One of his most famous work was his set of preludes. These 24 p ...

  2. nyoj 25-A Famous Music Composer(字符串)

    25-A Famous Music Composer 内存限制:64MB 时间限制:1000ms Special Judge: No accepted:4 submit:9 题目描述: Mr. B i ...

  3. 07-语言入门-07-A Famous Music Composer

    题目地址: http://blog.csdn.net/sevenmit/article/details/8231994  描述 Mr. B is a famous music composer. On ...

  4. A Famous Music Composer

    描述 Mr. B is a famous music composer. One of his most famous work was his set of preludes. These 24 p ...

  5. nyoj25-A Famous Music Composer

    A Famous Music Composer 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 Mr. B is a famous music composer. One ...

  6. 【南阳OJ分类之语言入门】80题题目+AC代码汇总

    小技巧:本文之前由csdn自动生成了一个目录,不必下拉一个一个去找,可通过目录标题直接定位. 本文转载自本人的csdn博客,复制过来的,排版就不弄了,欢迎转载. 声明: 题目部分皆为南阳OJ题目. 代 ...

  7. 南阳oj水题集合,语言的灵活运用

    a+b 输入 输入两个数,a,b 输出 输出a+b的值 样例输入 2 3 样例输出 5 c/c++ #include<iostream> using namespace std; int ...

  8. nyoj 484-The Famous Clock

    484-The Famous Clock 内存限制:64MB 时间限制:1000ms 特判: No 通过数:2 提交数:2 难度:1 题目描述: Mr. B, Mr. G and Mr. M are ...

  9. NYOJ-79 拦截导弹 AC 分类: NYOJ 2014-01-01 23:25 167人阅读 评论(0) 收藏

    #include<stdio.h> int main(){ int num[1000]={0}; int n,m,x,y; scanf("%d",&n); wh ...

随机推荐

  1. fiddler4手机抓包

  2. OpenResty知识汇集

    OpenResty目录详解: nginx_lua_module执行顺序:

  3. iOS基于AVPlayer的视频播放

    基于 AVPlayer 自定义播放器http://www.cocoachina.com/ios/20160921/17609.html,http://www.2cto.com/kf/201608/53 ...

  4. Reflect(反射)

    反射.反射,程序员的快乐.反射是无处不在的. 那么什么是反射:通过反射,可以在运行时获得程序或程序集中每一个类型(包括类.结构.委托.接口和枚举等)的成员和成员的信息.有了反射,即可对每一个类型了如指 ...

  5. [leetcode-504-Base 7]

    Given an integer, return its base 7 string representation. Example 1: Input: 100 Output: "202&q ...

  6. 外部世界如何访问容器? - 每天5分钟玩转 Docker 容器技术(37)

    上节我们学习了容器如何访问外部网络,今天讨论另一个方向:外部网络如何访问到容器? 答案是:端口映射. docker 可将容器对外提供服务的端口映射到 host 的某个端口,外网通过该端口访问容器.容器 ...

  7. MQ的导出备份

    参考链接: http://www.ibm.com/developerworks/cn/websphere/library/techarticles/1312_hub_mq/1312_hub_mq.ht ...

  8. 【原】无脑操作:Windows 10 + MySQL 5.5 安装使用及免安装使用

    本文介绍Windows 10环境下, MySQL 5.5的安装使用及免安装使用 资源下载: MySQL安装文件:http://download.csdn.net/detail/lf19820717/9 ...

  9. vijos1196题解

    Matrix67和Shadow正在做一个小游戏. 桌子上放着两堆糖果,Matrix67和Shadow轮流对这些糖果进行操作.在每一次操作中,操作者需要吃掉其中一堆糖果,并且把另一堆糖果分成两堆(可以不 ...

  10. Eclipse 快捷键和模板设置

    快捷键设置 菜单  Window --> Preferences---General---Keys Content Assist:  代码提示快捷键 模板设置 新建一个模板 在Insert Va ...