题目25 A Famous Music Composer

来源:互联网 发布:spring入门经典 源码 编辑:程序博客网 时间:2024/06/05 06:59

    已AC代码:

#include<cstdio>#include<cstring>int main(){    char s1[10], s2[10];    int temp, cont=1;    while(scanf("%s %s", s1, s2) != EOF)    {        temp = 0;        if(!strcmp(s1,"Ab"))        {            printf("Case %d: G# %s\n", cont,s2);            temp++;            cont++;        }        if(!strcmp(s1,"G#"))        {            printf("Case %d: Ab %s\n", cont,s2);            temp++;            cont++;        }        if(!strcmp(s1,"A#"))        {            printf("Case %d: Bb %s\n", cont,s2);            temp++;            cont++;        }        if(!strcmp(s1,"Bb"))        {            printf("Case %d: A# %s\n", cont,s2);            temp++;            cont++;        }        if(!strcmp(s1,"C#"))        {            printf("Case %d: Db %s\n", cont,s2);            temp++;            cont++;        }        if(!strcmp(s1,"Db"))        {            printf("Case %d: C# %s\n", cont,s2);            temp++;            cont++;        }        if(!strcmp(s1,"D#"))        {            printf("Case %d: Eb %s\n", cont,s2);            temp++;            cont++;        }        if(!strcmp(s1,"Eb"))        {            printf("Case %d: D# %s\n", cont,s2);            temp++;            cont++;        }        if(!strcmp(s1,"F#"))        {            printf("Case %d: Gb %s\n", cont,s2);            temp++;            cont++;        }        if(!strcmp(s1,"Gb"))        {            printf("Case %d: F# %s\n", cont,s2);            temp++;            cont++;        }        if(!temp)        {            printf("Case %d: UNIQUE\n", cont);            cont++;        }    }    return 0;}


0 0
原创粉丝点击