NYOJ25 A Famous Music Composer

来源:互联网 发布:手机全透明软件 编辑:程序博客网 时间:2024/06/08 16:15

原题链接

史上最水题。


#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;}


0 0
原创粉丝点击