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 ...
随机推荐
- MAC机常用快捷键整理表格
MAC机常用快捷键整理表格 范围 快捷键 说明 图形 (Command 键)在某些 Apple 键盘上,此键也可能为标志() Control (Control 键) Alt Opt ...
- post和put的区别
post : 标识的是处理请求中资源表述的资源 put : 标识的是请求的资源表述 post : 支持多种类型的资源 put : 支持单一的资源
- 详细理解 > /dev/null 2>&1
0:表示键盘输入(stdin) 1:表示标准输出(stdout),系统默认是1 2:表示错误输出(stderr) "command >/dev/null 2>&1 &am ...
- HDU 2425 DNA repair (AC自动机+DP)
DNA repair Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- Umbraco中的Member登录时的Lock out功能
请参看文章 https://our.umbraco.org/forum/using-umbraco-and-getting-started/76389-preventing-member-lock-o ...
- jeecms附件标签用法
[#if content.attachments?size gt 0] [#list content.attachments as attach] <a id="attach${att ...
- Cloud Computing Deployment Models
Cloud computing can broadly be broken down into three main categories based on the deployment model. ...
- JTextField限制 输入数字
貌似有很多方法,先记了再说... 1.限制输入数字 用法 textfield.setDocument(new IntegerDocument()); class IntegerDocument ext ...
- VM中ubuntu已经正确配置了静态IP仍无法上网
情况描述:正确配置了ubuntu的IP,getway,DNS..无法ping通getway. 环境:宿主机:win7 32Bit 虚拟机:ununtu 10.04 VM:9.0.1 build-8 ...
- 放开Linux内核对用户进程可打开文件数和TCP连接的限制
一. 检查linux内核uname -alsb_release -a 二. 用户进程可打开文件数限制1) vim /etc/security/limits.conf* - nof ...