作者a999999976 (我是大肚,我不是宅男)
看板FJU-Stat97A
标题[心得] 程设
时间Thu Oct 29 14:15:10 2009
#include<stdio.h>
#include<stdlib.h>
int main(void)
{ int score;
printf("请输入你的成绩:>");
scanf("%d",&score);
switch(score)
//switch语言後面都要+break,否则会继续执行下一行
{ case 0:
printf("遭透啦!\n");
break; //中断,跳到整句话外面:pause
case 6:
printf("刚好及格!\n");
break;
case 8:
printf("不错嘛!\n");
break;
case 10:
printf("很棒!\n");
break;
default: //预设值()
printf("输入成绩有问题喔~\n");
}
system("pause");
return(0);
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.136.162.136
1F:→ seth0921:比郭佑慢 待会补嘘140.136.162.140 10/29 14:19