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. ...
随机推荐
- P5748-集合划分计数【EGF,多项式exp】
正题 题目链接:https://www.luogu.com.cn/problem/P5748 题目大意 求将\(n\)的排列分成若干个无序非空集合的方案. 输出答案对\(998244353\)取模. ...
- 小白学习Python英语基础差怎么办,都帮你想好拉!看这里
运算符与随机数 1.module:模块 2.sys(system):系统 3.path:路径 4.import:导入 5.from:从- 定义函数与设定参数 1.birthday:出生日期 2.yea ...
- FastAPI(45)- JSONResponse
背景 创建 FastAPI 路径操作函数时,通常可以从中返回任何数据:字典.列表.Pydantic 模型.数据库模型等 默认情况下,FastAPI 会使用 jsonable_encoder 自动将该返 ...
- WebMagic 爬虫技术
WebMagic WebMagic 介绍 WebMagic基础架构 Webmagic 的结构分为 Downloader.PageProcessor.Scheduler.Pipeline四大组件,并由 ...
- 基于python深度学习的apk风险预测脚本
基于python深度学习的apk风险预测脚本 为了有效判断安卓apk有无恶意操作,利用python脚本,通过解包apk文件,对其中xml文件进行特征提取,通过机器学习构建模型,预测位置的apk包是否有 ...
- windos10环境下编译python3版pjsua库
环境:windows10_x64python3.9_x64pjsua-2.10vs2015 pjsua编译参考这里: https://www.cnblogs.com/MikeZhang/p/pjsip ...
- ArcPy数据列表遍历
ArcPy数据列表遍历 批处理脚本的首要任务之一是为可用数据编写目录,以便在处理过程中可以遍历数据. ArcPy 具有多个专为创建此类列表而构建的函数. 函数 说明 ListFields(datase ...
- 实用 | 利用 aardio 配合 Python 快速开发桌面应用
1. 前言 大家好,我是安果! 我们都知道 Python 可以用来开发桌面应用,一旦功能开发完成,最后打包的可执行文件体积大,并且使用 Python 开发桌面应用周期相对较长 假如想快速开发一款 PC ...
- Perl操作excel2007的模块
详细版:https://www.jianshu.com/p/84bda53827c8 第一种方法: 读写excel2007文档的perl模块: Spreadsheet::XLSX(读)和Spreads ...
- .NET 分布式系统架构(有转载部分)
一.设计目的 搭建一个大型平台需要综合考虑很多方面,不单纯是软件架构,还包括网络和硬件设备等.由于现代大部分应用建设都面临用户多.高并发.高可用的需求,传统软件架构已不能满足需求,需要支持分布式软件架 ...