描述
"Doe, a deer, a female deer Ray, a drop of golden sun Me, a name I call myself Far, a long, long way to run Sew, a needle pulling thread La, a note to follow Sew Tea, a drink with jam and bread That will bring us back to Do ..." 没错,上面的歌词就是我们熟悉的《音乐之声》中的经典歌曲《哆来咪》,现在我们用这段歌词来做一个选择语句的练习吧~ 注:请使用if..else语句或switch语句完成。
-
输入
-
包括多组数据。每组数据包括一个整数x,(1<=x<=7) x的值对应音符"1"到"7"。
输出
-
对于每组数据输出一行对应的歌词。详见样例。
样例输入
-
1
2
3
4
5
6
7
样例输出
-
Doe, a deer, a female deer
Ray, a drop of golden sun
Me, a name I call myself
Far, a long, long way to run
Sew, a needle pulling thread
La, a note to follow Sew
Tea, a drink with jam and bread
水题
#include <stdio.h> int main() { int c; while (scanf("%d",&c)!=EOF) { if(c==1) printf("Doe, a deer, a female deer\n"); if(c==2) printf("Ray, a drop of golden sun\n"); if(c==3) printf("Me, a name I call myself\n"); if(c==4) printf("Far, a long, long way to run\n"); if(c==5) printf("Sew, a needle pulling thread\n"); if(c==6) printf("La, a note to follow Sew\n"); if(c==7) printf("Tea, a drink with jam and bread\n"); } return 0; }