标签:des style blog ar color os sp java for
描述
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 |
Ab minor
D# major
G minor
Case 1: G# minor
Case 2: Eb major
Case 3: UNIQUE
1 import java.util.Scanner; 2 3 public class Main { 4 public static void main(String[] args) { 5 Scanner scanner=new Scanner(System.in); 6 String s1; 7 String s2; 8 String compare="A B C D E F G"; 9 String output=null; 10 int time; 11 12 time=1; 13 while(scanner.hasNext()){ 14 s1=scanner.next(); 15 s2=scanner.next(); 16 17 if(compare.indexOf(s1)!=-1) 18 output="UNIQUE"; 19 20 else if(s1.compareTo("A#")==0) 21 output="Bb"+" "+s2; 22 23 else if(s1.compareTo("Bb")==0) 24 output="A#"+" "+s2; 25 26 else if(s1.compareTo("C#")==0) 27 output="Db"+" "+s2; 28 29 else if(s1.compareTo("Db")==0) 30 output="C#"+" "+s2; 31 32 else if(s1.compareTo("D#")==0) 33 output="Eb"+" "+s2; 34 35 else if(s1.compareTo("Eb")==0) 36 output="D#"+" "+s2; 37 38 else if(s1.compareTo("F#")==0) 39 output="Gb"+" "+s2; 40 41 else if(s1.compareTo("Gb")==0) 42 output="F#"+" "+s2; 43 44 else if(s1.compareTo("G#")==0) 45 output="Ab"+" "+s2; 46 47 else if(s1.compareTo("Ab")==0) 48 output="G#"+" "+s2; 49 50 System.out.println("Case "+time+": "+output); 51 time++; 52 } 53 54 55 56 } 57 }
标签:des style blog ar color os sp java for
原文地址:http://www.cnblogs.com/zqxLonely/p/4130389.html