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. ...
随机推荐
- P7443-加边【博弈论】
正题 题目链接:https://www.luogu.com.cn/problem/P7443?contestId=41429 题目大意 \(n\)个点的一棵有根树,两个人从一号点开始进行有向图博弈. ...
- Redis之品鉴之旅(四)
发布订阅,简单场景下的发布订阅完全可以使用. 可以简单的理解,将一个公众号视为发布者,关注公众号的人视作订阅者,公众号发布一条文章或者消息,凡事订阅公众号的都可以收到消息.一个人可以订阅多个公众号,一 ...
- 深入浅出WPF-03.XAML语法
2 XAML语法 树形结构,我们将整个XAML的结构想象成一棵树,我们从树的顶部向下看,形成俯视图.最上面的叶子节点会覆盖父节点,同级的子节点,后面的(也就是树的最上面)会覆盖前面的.覆盖包含了形状( ...
- MyBatis切换至MyBatis-plus踩坑Invalid bound statement (not found):
部分情况可以参考https://blog.csdn.net/wwrzyy/article/details/86034458 我的问题出现的根本原因就是没有扫描到mapper的xml文件 因为MyBat ...
- Oracle实时数据抽取项目问题总结
Oracle实时数据抽取项目问题总结 项目背景介绍 项目主要是将Oracle.MySQL.SQLServer.Db2等其他数据库的实时变更数据同步到其他异构数据库中.本篇文章主要是讨论oracle的实 ...
- mysql从零开始之MySQL 创建数据库
MySQL 创建数据库 我们可以在登陆 MySQL 服务后,使用 create 命令创建数据库,语法如下: CREATE DATABASE 数据库名; 以下命令简单的演示了创建数据库的过程,数据名为 ...
- 从0到1使用Kubernetes系列——Kubernetes入门
基本概念 Docker 是什么 Docker 起初是 dotCloud 公司创始人 Solomon Hykes 在法国的时候发起的一项公司内部项目,Docker 是基于 dotCloud 公司多年云服 ...
- 我在阿里巴巴做 Serverless 云开发平台
技术的成熟度源自大规模的实践,Java 领域,阿里将自身的实践源源不断的反哺给微服务技术体系:Node.js 领域,阿里正掀起了前所未有的前端革命浪潮,将实践反哺给 Serverless技术体系,并逐 ...
- C#开发BIMFACE系列45 服务端API之创建离线数据包
BIMFACE二次开发系列目录 [已更新最新开发文章,点击查看详细] BIMFACE的常规应用方式有公有云与私有化部署两种方式,并且浏览模型或者图纸需要使用ViewToken,ViewToke ...
- Java初步学习——2021.10.05每日总结,第五周周三
(1)今天做了什么: (2)明天准备做什么? (3)遇到的问题,如何解决? 今天学了对象与类,如何定义类和创建对象,以及构建方法的用法. 明天课比较多,把今天未学的例子敲一遍好了. 没有遇到什么问题.