描述
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
 1 #include <stdio.h>
2 #include <string.h>
3 int main( ) {
4 char s1[10],s2[10];
5 int sign = 1;
6 while(scanf("%s%s",s1,s2) != EOF) {
7 printf("Case %d: ",sign++);
8 if(!strcmp(s1,"A#"))
9 printf("%s %s\n","Bb",s2);
10 else if(!strcmp(s1,"Bb"))
11 printf("%s %s\n","A#",s2);
12 else if(!strcmp(s1,"C#"))
13 printf("%s %s\n","Db",s2);
14 else if(!strcmp(s1,"Db"))
15 printf("%s %s\n","C#",s2);
16 else if(!strcmp(s1,"D#"))
17 printf("%s %s\n","Eb",s2);
18 else if(!strcmp(s1,"Eb"))
19 printf("%s %s\n","D#",s2);
20 else if(!strcmp(s1,"F#"))
21 printf("%s %s\n","Gb",s2);
22 else if(!strcmp(s1,"Gb"))
23 printf("%s %s\n","F#",s2);
24 else if(!strcmp(s1,"G#"))
25 printf("%s %s\n","Ab",s2);
26 else if(!strcmp(s1,"Ab"))
27 printf("%s %s\n","G#",s2);
28 else
29 printf("UNIQUE\n");
30 }
31 return 0;
32 }

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

  1. NYOJ 25 A Famous Music Composer

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

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

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

  3. 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 ...

  4. nyoj25-A Famous Music Composer

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

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

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

  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. 【转载】PHP 开发者该知道的 5 个 Composer 小技巧

    Composer是新一代的PHP依赖管理工具.其介绍和基本用法可以看这篇<Composer PHP依赖管理的新时代>.本文介绍使用Composer的五个小技巧,希望能给你的PHP开发带来方 ...

  9. composer安装fxp插件时候提示内存不足且没有交换空间的解决办法

    The following exception is caused by a lack of memory and not having swap Check https://getcomposer. ...

随机推荐

  1. 自然语言处理标注工具——Brat(安装、测试、使用)

    一.Brat标注工具安装 1.安装条件: (1)运行于Linux系统(window系统下虚拟机内linux系统安装也可以) (2)目前brat最新版本(v1.3p1)仅支持python2版本运行使用( ...

  2. 讲讲java中线程池的实现

    今天跟一个同学谈到java中的线程池的实现,才发现有些知识点已经记不清了,所以特意把源码打开,对官方文档做了些说明. 其实这些理解了之后,读懂源码应该是没多大问题了,有感兴趣的小伙伴们可以看完说明后自 ...

  3. Frida高级逆向-Hook Native(Java So)2

    Frida Hook So 一些操作说明 Native方法第一个参数是 JNIEnv *env 如何在Frida中获取 JNIEnv 对象呢? Java.vm.getEnv(); 如何将string类 ...

  4. FastAPI 学习之路(三十二)创建数据库

    在大型的web开发中,我们肯定会用到数据库操作,那么FastAPI也支持数据库的开发,你可以用 PostgreSQL MySQL SQLite Oracle 等 本文用SQLite为例.我们看下在fa ...

  5. Redis使用过程中有哪些注意事项?看看BAT这类的公司是正确使用Redis的!!

    Redis使用过程中要注意的事项 Redis使用起来很简单,但是在实际应用过程中,一定会碰到一些比较麻烦的问题,常见的问题有 redis和数据库数据的一致性 缓存雪崩 缓存穿透 热点数据发现 下面逐一 ...

  6. .Net 5下的单文件部署

    由于.net程序没有静态链接,一直缺乏单文件部署这种干净的发布方案.对客户端程序发布并不是很友好.在之前的.net framework下,有ILMerge合并程序集,以及LibZ的嵌入资源文件等第三方 ...

  7. 第0次 Beta Scrum Meeting

    本次会议为Beta阶段第0次Scrum Meeting会议 会议概要 会议时间:2021年5月27日 会议地点:「腾讯会议」线上进行 会议时长:1小时 会议内容简介:本次会议为Beta阶段启程会议,主 ...

  8. the Agiles Scrum Meeting 9

    会议时间:2020.4.17 20:00 1.每个人的工作 今天已完成的工作 个人结对项目增量开发组:基本实现个人项目创建.仓库自动分配,修复bug issues: 增量组:准备评测机制,增加仓库自动 ...

  9. .net,C#,Vb,F#,Asp,Asp.net区别以及作用和方向

    .net是平台,其他都是运行在其.NET FrameWork环境下的 C#,Vb都是语言运行在.net 平台下 Asp,Asp.net 都是用来写Web网页的,但是Asp和Asp.net有区别 Asp ...

  10. 热身训练1 Blood Cousins Return

    点此看题 简要题面: 一棵树上有n个节点,每个节点有对应的名字(名字可重复). 每次询问,求深度比$vi$多$ki$的$vi$的儿子中,有多少种名字 分析: Step1: 我们可以懂$DFS$轻松找到 ...