A Famous Music Composer
描述
A | A#=Bb | B | C | C#=Db | D | D#=Eb | E | F | F#=Gb | G | G#=Ab |
Ab minor | A# major | A# minor | C# major | Db minor |
D# major | D# minor | Gb major | Gb minor | G# major |
- 输入
- 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: UNIQUEimport java.util.Scanner; public class Main {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
String s1;
String s2;
String compare="A B C D E F G";
String output=null;
int time; time=1;
while(scanner.hasNext()){
s1=scanner.next();
s2=scanner.next(); if(compare.indexOf(s1)!=-1)
output="UNIQUE"; else if(s1.compareTo("A#")==0)
output="Bb"+" "+s2; else if(s1.compareTo("Bb")==0)
output="A#"+" "+s2; else if(s1.compareTo("C#")==0)
output="Db"+" "+s2; else if(s1.compareTo("Db")==0)
output="C#"+" "+s2; else if(s1.compareTo("D#")==0)
output="Eb"+" "+s2; else if(s1.compareTo("Eb")==0)
output="D#"+" "+s2; else if(s1.compareTo("F#")==0)
output="Gb"+" "+s2; else if(s1.compareTo("Gb")==0)
output="F#"+" "+s2; else if(s1.compareTo("G#")==0)
output="Ab"+" "+s2; else if(s1.compareTo("Ab")==0)
output="G#"+" "+s2; System.out.println("Case "+time+": "+output);
time++;
} }
}
A Famous Music Composer的更多相关文章
- 07-语言入门-07-A Famous Music Composer
题目地址: http://blog.csdn.net/sevenmit/article/details/8231994 描述 Mr. B is a famous music composer. On ...
- NYOJ 25 A Famous Music Composer
A Famous Music Composer 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 Mr. B is a famous music composer. O ...
- 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 ...
- 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 p ...
- 【南阳OJ分类之语言入门】80题题目+AC代码汇总
小技巧:本文之前由csdn自动生成了一个目录,不必下拉一个一个去找,可通过目录标题直接定位. 本文转载自本人的csdn博客,复制过来的,排版就不弄了,欢迎转载. 声明: 题目部分皆为南阳OJ题目. 代 ...
- 南阳oj水题集合,语言的灵活运用
a+b 输入 输入两个数,a,b 输出 输出a+b的值 样例输入 2 3 样例输出 5 c/c++ #include<iostream> using namespace std; int ...
- Laravel Composer and ServiceProvider
Composer and: 创建自定义类库时,按命名空间把文件夹结构组织好 composer.json>autoload>classmap>psr-4 composer dump-a ...
- 基于Composer Player 模型加载和相关属性设置
主要是基于达索软件Composer Player.的基础上做些二次开发. public class ComposerToolBarSetting { public bool AntiAliasingO ...
随机推荐
- 多校5 1001 HDU5781 ATM Mechine 记忆化搜索+概率
// 多校5 1001 HDU5781 ATM Mechine // http://acm.hdu.edu.cn/search.php?field=problem&key=2016+Multi ...
- codevs3044 线段树+扫描线
3044 矩形面积求并 http://hzwer.com/879.html 扫描线 // #pragma comment(linker, "/STACK:1024000000,1024000 ...
- Tkinter教程之Scale篇
本文转载自:http://blog.csdn.net/jcodeer/article/details/1811313 '''Tkinter教程之Scale篇'''#Scale为输出限定范围的数字区间, ...
- JSON 省市数据包括港澳
data: [{ name: "北京", cities: ["西城", "东城", "崇文", "宣武&quo ...
- [Hive - LanguageManual ] Explain (待)
EXPLAIN Syntax EXPLAIN Syntax Hive provides an EXPLAIN command that shows the execution plan for a q ...
- 【转】linux shell 正则表达式(BREs,EREs,PREs)差异比较
我想各位也和我一样,再linux下使用grep,egrep, awk , sed, vi的搜索时,会经常搞不太清楚,哪此特殊字符得使用转义字符'\' .. 哪些不需要, grep与egrep的差异 ...
- NodeJS:树的反序列化
!!不知问啥,cnblog的MarkDown编辑器不好使了. 本文也在我的博客edwardesire.com上,欢迎品尝. 树的反序列化就是将序列数组安装线索组成树结构,今次项目数据库存储决策节点的方 ...
- Spark Streaming 原理剖析
通过源码呈现 Spark Streaming 的底层机制. 1. 初始化与接收数据 Spark Streaming 通过分布在各个节点上的接收器,缓存接收到的流数据,并将流数 据 包 装 成 Spar ...
- Unity3D之Mecanim动画系统学习笔记(一):认识Mecanim动画系统
Mecanim简介 Mecanim动画系统是Unity3D4.0开始引入的一套全新的动画系统,主要提供了下面4个方面的功能: 针对人形角色提供一套特殊的工作流. 动画重定向的能力,可以非常方便的把动画 ...
- [置顶] Jquery中DOM操作(详细)
Jquery中的DOM操作 为了能全面的讲解DOM操作,首先需要构建一个网页. HTML代码: <%@ page language="java" import="j ...