A Famous Music Composer

时间限制:1000 ms  |  内存限制:65535 KB
难度:1
 
描述
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.
样例输入
  1. Ab minor
  2. D# major
  3. G minor
样例输出
  1. Case 1: G# minor
  2. Case 2: Eb major
  3. Case 3: UNIQUE

让我告诉你你WA的原因:

  1. printf("Case %d: ",sign++);
  2.  
  3. "Case 1: "冒号后面还有个空格。
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4. {
  5. char s1[],s2[];
  6. int sign = ;
  7. while(scanf("%s%s",s1,s2) != EOF)
  8. {
  9. printf("Case %d: ",sign++);
  10. if(!strcmp(s1,"A#")) printf("%s %s\n","Bb",s2);
  11. else if(!strcmp(s1,"Bb")) printf("%s %s\n","A#",s2);
  12. else if(!strcmp(s1,"C#")) printf("%s %s\n","Db",s2);
  13. else if(!strcmp(s1,"Db")) printf("%s %s\n","C#",s2);
  14. else if(!strcmp(s1,"D#")) printf("%s %s\n","Eb",s2);
  15. else if(!strcmp(s1,"Eb")) printf("%s %s\n","D#",s2);
  16. else if(!strcmp(s1,"F#")) printf("%s %s\n","Gb",s2);
  17. else if(!strcmp(s1,"Gb")) printf("%s %s\n","F#",s2);
  18. else if(!strcmp(s1,"G#")) printf("%s %s\n","Ab",s2);
  19. else if(!strcmp(s1,"Ab")) printf("%s %s\n","G#",s2);
  20. else printf("UNIQUE\n");
  21. }
  22. }

NYOJ 25 A Famous Music Composer的更多相关文章

  1. 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 ...

  2. nyoj 25-A Famous Music Composer(字符串)

    25-A Famous Music Composer 内存限制:64MB 时间限制:1000ms Special Judge: No accepted:4 submit:9 题目描述: Mr. B i ...

  3. 07-语言入门-07-A Famous Music Composer

    题目地址: http://blog.csdn.net/sevenmit/article/details/8231994  描述 Mr. B is a famous music composer. On ...

  4. 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 ...

  5. nyoj25-A Famous Music Composer

    A Famous Music Composer 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 Mr. B is a famous music composer. One ...

  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. nyoj 484-The Famous Clock

    484-The Famous Clock 内存限制:64MB 时间限制:1000ms 特判: No 通过数:2 提交数:2 难度:1 题目描述: Mr. B, Mr. G and Mr. M are ...

  9. NYOJ-79 拦截导弹 AC 分类: NYOJ 2014-01-01 23:25 167人阅读 评论(0) 收藏

    #include<stdio.h> int main(){ int num[1000]={0}; int n,m,x,y; scanf("%d",&n); wh ...

随机推荐

  1. php变量双击选择无法选择$符号

    创建/Data/Packages/User/PHP.sublime-settings文件,内容为 {     "word_separators": "./\\()\&qu ...

  2. 使用javac编译zookeeper项目

    这里记录zookeeper编译源代码上的一些细节的问题. 网上不少关于如何使用ant eclipse来构建zookeeper对应的eclipse工程的记录.这里就不再过多赘述.只做简单阐述. 这里主要 ...

  3. JavaScript中的栈及通过栈操作的实例

    <script> /*栈操作*/ function Stack() { this.dataStore = []; this.top = 0; this.push = push; this. ...

  4. MapReduce执行流程及程序编写

    MapReduce 一种分布式计算模型,解决海量数据的计算问题,MapReduce将计算过程抽象成两个函数 Map(映射):对一些独立元素(拆分后的小块)组成的列表的每一个元素进行指定的操作,可以高度 ...

  5. Java 容器在实际项目中的应用

    前言:在java开发中我们离不开集合数组等,在java中有个专有名词:"容器" ,下面会结合Thinking in Java的知识和实际开发中业务场景讲述一下容器在Web项目中的用 ...

  6. P2286 [HNOI2004]宠物收养场

    题目描述 凡凡开了一间宠物收养场.收养场提供两种服务:收养被主人遗弃的宠物和让新的主人领养这些宠物. 每个领养者都希望领养到自己满意的宠物,凡凡根据领养者的要求通过他自己发明的一个特殊的公式,得出该领 ...

  7. Java基础语法<八> 继承

    1.超类和子类 超类和子类 父类与子类 多态: 一个对象变量可以指示多种实际类型的现象称为多态 一个变量可以引用父类对象,也可以引用其子类对象,这就是多态. 不能将一个超类的引用赋给子类变量,因为调用 ...

  8. PHP面向对象 ——多态

    接口 接口(interface)是抽象方法和静态常量定义的集合. 接口是一种特殊的抽象类,这种抽象类中只包含抽象方法和静态常量. 接口中没有其它类型的内容 接口的定义 /** * 接口可以认为是特殊的 ...

  9. 使用apidoc根据JS文件生成接口文档

    1.安装nodejs.下载网址:http://www.nodejs.org: 2.安装apidoc.运行cmd,切换到nodejs的安装目录,在命令行输入: 1 npm install apidoc ...

  10. 常用http响应报文分析

    这是我在使用Asp.Net的时候,整理的的一些关于Http响应报文的分析笔记,零零散散的记录, 现在贴出来,抛砖引玉,如果有什么不对或者不严谨的地方,请各位大神不吝赐教. 一.HTTP响应码响应码由三 ...