描述
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. YbtOJ#631-次短路径【左偏树,最短路】

    正题 题目链接:https://www.ybtoj.com.cn/contest/114/problem/1 题目大意 给出\(n\)个点\(m\)条边的一张无向图,对于每个点\(i\)求不经过\(i ...

  2. 实例:建立图书借阅系统的UML模型

    1.需求分析 图书借阅系统的组成 2.具体的功能详细描述: (1)管理员登录系统,进入借书工作状态,等待借书处理. (2)读者找到所需图书,在借书处上刷卡机上刷卡. (3)管理员对借阅证进行资格审查. ...

  3. vulnhub靶机-Me and My Girlfriend: 1

    vulnhub靶机实战 1.靶机地址:https://www.vulnhub.com/entry/me-and-my-girlfriend-1,409/ 2.先看描述(要求) 通过这个我们可以知道我们 ...

  4. vue 快速入门 系列 —— vue-router

    其他章节请看: vue 快速入门 系列 Vue Router Vue Router 是 Vue.js 官方的路由管理器.它和 Vue.js 的核心深度集成,让构建单页面应用变得易如反掌. 什么是路由 ...

  5. Java基础- 重写,重构和重载

    重写也称为覆盖, 是指子类与父类的方法名相同但是可以有不同的权限(子类权限需大于父类),返回值(J2SE 5.0以后增加的功能,且子类的返回值必须是父类返回值的子类)或者方法实现. 重写体现了子类补充 ...

  6. harmony OS 开发工具安装

    harmony OS 开发工具安装 安装流程 安装完成 初始配置 双击打开 Running DevEco Studio requires the npm configuration informati ...

  7. 高效动画实现原理-Jetpack Compose 初探索

    一.简介 Jetpack Compose是Google推出的用于构建原生界面的新Android 工具包,它可简化并加快 Android上的界面开发.Jetpack Compose是一个声明式的UI框架 ...

  8. Redis分布式锁的正确实现方式[转载]

    前言 分布式锁一般有三种实现方式:1. 数据库乐观锁:2. 基于Redis的分布式锁:3. 基于ZooKeeper的分布式锁.本篇博客将介绍第二种方式,基于Redis实现分布式锁.虽然网上已经有各种介 ...

  9. 【二食堂】Beta - 事后分析

    事后分析 设想和目标 我们的软件要解决什么问题?是否定义得很清楚?是否对典型用户和典型场景有清晰的描述? Beta阶段我们首先要对文本标注方式进行优化,其次时添加好友系统,实现邀请好友共同标注的功能. ...

  10. GitHub README文件生成目录导航

    效果 环境说明 [root@C61 ~]# cat /etc/redhat-release CentOS release 6.10 (Final) [root@C61 ~]# uname -a Lin ...