switch中奖号码
#include<stdio.h> int main(void) { int choice=0; printf("\nPick a number between 1 and 10 and you may win a prize!"); scanf("&d",choice); if((choice>10)||(choice<1)) choice=11; switch(choice) { case 7: printf("\nCongratulations!"); printf("\nYou win the collectde works of Amos Grunt futtock."); break; default: printf("\n Sorry,you lose.\n"); break; } return 0; }
简单的switch语句来练习
年轻的时候,就要去多吃苦。去拼搏,去闯,否则老了,连谈资都没有!