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 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的更多相关文章
- NYOJ 25 A Famous Music Composer
A Famous Music Composer 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 Mr. B is a famous music composer. O ...
- 07-语言入门-07-A Famous Music Composer
题目地址: http://blog.csdn.net/sevenmit/article/details/8231994 描述 Mr. B is a famous music composer. On ...
- 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 ...
- nyoj25-A Famous Music Composer
A Famous Music Composer 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 Mr. B is a famous music composer. One ...
- nyoj 25-A Famous Music Composer(字符串)
25-A Famous Music Composer 内存限制:64MB 时间限制:1000ms Special Judge: No accepted:4 submit:9 题目描述: Mr. B i ...
- 【南阳OJ分类之语言入门】80题题目+AC代码汇总
小技巧:本文之前由csdn自动生成了一个目录,不必下拉一个一个去找,可通过目录标题直接定位. 本文转载自本人的csdn博客,复制过来的,排版就不弄了,欢迎转载. 声明: 题目部分皆为南阳OJ题目. 代 ...
- 南阳oj水题集合,语言的灵活运用
a+b 输入 输入两个数,a,b 输出 输出a+b的值 样例输入 2 3 样例输出 5 c/c++ #include<iostream> using namespace std; int ...
- 【转载】PHP 开发者该知道的 5 个 Composer 小技巧
Composer是新一代的PHP依赖管理工具.其介绍和基本用法可以看这篇<Composer PHP依赖管理的新时代>.本文介绍使用Composer的五个小技巧,希望能给你的PHP开发带来方 ...
- composer安装fxp插件时候提示内存不足且没有交换空间的解决办法
The following exception is caused by a lack of memory and not having swap Check https://getcomposer. ...
随机推荐
- Dapr + .NET Core实战(七)Secrets
什么是Secrets 应用程序通常会通过使用专用的存储来存储敏感信息,如连接字符串.密钥等. 通常这需要建立一个密钥存储,如Azure Key Vault.Hashicorp等,并在那里存储应用程序级 ...
- docker-compose 搭建mongo集群
创建目录 在每台机器上操作此步骤 一.在编写容器文件之前的注意事项: 1.yaml文件的指令前端不能使用tab键只能使用空格 2.storage: 指令的对接只能使用 : 不能使用 = 冒号的后面要跟 ...
- 地形鞍部的提取(ArcPy实现)
1.背景 相邻两山头之间呈马鞍形的低凹部分称为鞍部.鞍部点是重要的地形控制点,它和山顶点.山谷点及山脊线.山谷线等构成地形特征点线,对地形具有很强的控制作用.因此,因此,对这些地形特征点.线的分析研究 ...
- [AGC023D] Go Home 题解
题目传送门 Solution 首先排除掉特殊情况:若 \(S\) 在两侧,肯定会顺序/逆序直接走完,答案就是边界减去出发点. 考虑到若 \(P_1\geq P_n\),那么显然 \(1\) 不到家 \ ...
- SpringBoot整合JDBC-调用数据库
SpringData 对于数据访问层,无论是 SQL(关系型数据库) 还是 NOSQL(非关系型数据库),Spring Boot 底层都是采用 Spring Data 的方式进行统一处理. Sprin ...
- 从零开始的Spring Session(一)
Session和Cookie这两个概念,在学习java web开发之初,大多数人就已经接触过了.最近在研究跨域单点登录的实现时,发现对于Session和Cookie的了解,并不是很深入,所以打算写两篇 ...
- [技术博客] 敏捷软工——JavaScript踩坑记
[技术博客] 敏捷软工--JavaScript踩坑记 一.一个令人影响深刻的坑 1.脚本语言的面向对象 面向对象特性是现代编程语言的基本特性,JavaScript中当然集成了面向对象特性.但是Java ...
- hystrix的配置说明
在我们的日常开发中,有些时候需要和第三方系统进行对接操作,或者调用其他系统的 api 接口,但是我们不能保证这些第三方系统的接口一定是稳定的,当系统中产生大量的流量来访问这些第三方接口,这些第三方系统 ...
- 关于评论区empty。。。
空荡荡的毫无人烟,博主希望路过的小哥哥/小姐姐(几率较小)留下些什么--
- C语言编程基础有网盘资料哦
刚开始看STM32的库函数,会有很多疑惑,例如指针怎么用,结构体跟指针怎么配合,例如函数的参数有什么要求,如何实时更新IO口的数据等.如果重新进行C语言的学习,那么要学很久才能够系统地认识.本文则将比 ...