NYOJ25 A Famous Music Composer
2014-04-07 11:40
417 查看
原题链接
史上最水题。
#include <stdio.h>
#include <string.h>
struct Node{
char *a, *b;
} sam[5] = {{"A#", "Bb"}, {"C#", "Db"}, {"D#", "Eb"}, {"F#", "Gb"}, {"G#", "Ab"}};
int main(){
char note[3], tona[6];
int count = 1, ok;
while(scanf("%s%s", note, tona) == 2){
printf("Case %d: ", count++);
if(strlen(note) == 1){
printf("UNIQUE\n");
continue;
}
for(int i = 0; i < 5; ++i){
if(strcmp(note, sam[i].a) == 0) memcpy(note, sam[i].b, 2);
else if(strcmp(note, sam[i].b) == 0) memcpy(note, sam[i].a, 2);
}
printf("%s %s\n", note, tona);
}
return 0;
}
史上最水题。
#include <stdio.h>
#include <string.h>
struct Node{
char *a, *b;
} sam[5] = {{"A#", "Bb"}, {"C#", "Db"}, {"D#", "Eb"}, {"F#", "Gb"}, {"G#", "Ab"}};
int main(){
char note[3], tona[6];
int count = 1, ok;
while(scanf("%s%s", note, tona) == 2){
printf("Case %d: ", count++);
if(strlen(note) == 1){
printf("UNIQUE\n");
continue;
}
for(int i = 0; i < 5; ++i){
if(strcmp(note, sam[i].a) == 0) memcpy(note, sam[i].b, 2);
else if(strcmp(note, sam[i].b) == 0) memcpy(note, sam[i].a, 2);
}
printf("%s %s\n", note, tona);
}
return 0;
}
相关文章推荐
- NYOJ--25--A Famous Music Composer
- nyoj 25 A Famous Music Composer
- 【NYOJ】[25]A Famous Music Composer
- nyoj_25 A Famous Music Composer
- NYOJ:25-A Famous Music Composer
- NYOJ 25 A Famous Music Composer
- NYOJ --25--A Famous Music Composer
- NYOJ-25-A Famous Music Composer-2013年09月26日08:54:55
- nyoj 25 A Famous Music Composer
- NYOJ 题目25 A Famous Music Composer
- hdu 4245 nyoj 25 A Famous Music Composer
- 题目25 A Famous Music Composer
- 25 A Famous Music Composer
- 南阳oj 题目25 A Famous Music Composer
- 南阳题目25-A Famous Music Composer
- A Famous Music Composer(南阳oj25)(一道无聊的英文题)
- NYOJ - A Famous Music Composer
- NY25 A Famous Music Composer
- 南阳oj 25 A Famous Music Composer (水题,字符串替换问题)
- 题目25-A Famous Music Composer