NYOJ A Famous Music Composer

来源:互联网 发布:淘宝网购物下载 编辑:程序博客网 时间:2024/05/29 13:46
#include <stdio.h>#include <stdlib.h>#include <assert.h>int main (void){    int test_case = 0;    char note[1000];    while ( gets( note ) != NULL )    {        test_case ++;        if ( note[0] == 'A' && note[1] == ' ' )            printf( "Case %d: UNIQUE\n", test_case );        else if ( note[0] == 'A' && note[1] == '#' )        {            note[0] = 'B';            note[1] = 'b';            printf( "Case %d: %s\n", test_case, note );        }        else if ( note[0] == 'B' && note[1] == 'b' )        {            note[0] = 'A';            note[1] = '#';            printf( "Case %d: %s\n", test_case, note );        }        else if ( note[0] == 'B' && note[1] == ' ' )            printf( "Case %d: UNIQUE\n", test_case );        else if ( note[0] == 'C' && note[1] == ' ' )            printf( "Case %d: UNIQUE\n", test_case );        else if ( note[0] == 'C' && note[1] == '#' )        {            note[0] = 'D';            note[1] = 'b';            printf( "Case %d: %s\n", test_case, note );        }        else if ( note[0] == 'D' && note[1] == 'b' )        {            note[0] = 'C';            note[1] = '#';            printf( "Case %d: %s\n", test_case, note );        }        else if ( note[0] == 'D' && note[1] == ' ' )            printf( "Case %d: UNIQUE\n", test_case );        else if ( note[0] == 'D' && note[1] == '#' )        {            note[0] = 'E';            note[1] = 'b';            printf( "Case %d: %s\n", test_case, note );        }        else if ( note[0] == 'E' && note[1] == 'b' )        {            note[0] = 'D';            note[1] = '#';            printf( "Case %d: %s\n", test_case, note );        }        else if ( note[0] == 'E' && note[1] == ' ' )            printf( "Case %d: UNIQUE\n", test_case );        else if ( note[0] == 'F' && note[1] == ' ' )            printf( "Case %d: UNIQUE\n", test_case );        else if ( note[0] == 'F' && note[1] == '#' )        {            note[0] = 'G';            note[1] = 'b';            printf( "Case %d: %s\n", test_case, note );        }        else if ( note[0] == 'G' && note[1] == 'b' )        {            note[0] = 'F';            note[1] = '#';            printf( "Case %d: %s\n", test_case, note );        }        else if ( note[0] == 'G' && note[1] == ' ' )            printf( "Case %d: UNIQUE\n", test_case );        else if ( note[0] == 'G' && note[1] == '#' )        {            note[0] = 'A';            note[1] = 'b';            printf( "Case %d: %s\n", test_case, note );        }        else if ( note[0] == 'A' && note[1] == 'b' )        {            note[0] = 'G';            note[1] = '#';            printf( "Case %d: %s\n", test_case, note );        }        else            assert(false);    }    return EXIT_SUCCESS;}

0 0