c语言问题。输入数据要符合要求,不符合提示错误并重性输入

[复制链接]
查看11 | 回复3 | 2013-3-28 06:42:49 | 显示全部楼层 |阅读模式
/ *092134179x:输入错误,继续进入尾声的'#' 21344009764x:输入错误,继续进入尾声的'#' 09213417921344009764 新闻任意键继续 * / #包括 #,包括 廉政的main() {字符CH = 0, [36];INT I = 0; (1){ CH =的getch(); (CH> = '0'&& CH int main(){int i;scanf( "%d" , &i );getchar(); //因输入用回车确认,所以要过滤掉回车,故加个getchar()while ( i2 ){printf("input error,re-input:");scanf( "%d" , ...
回复

使用道具 举报

千问 | 2013-3-28 06:42:49 | 显示全部楼层
#include int main(){int n;do{printf("请选择: 0.XXXX 1.YYYY 或 2.ZZZZ:"); scanf("%d",&n);}while...
回复

使用道具 举报

千问 | 2013-3-28 06:42:49 | 显示全部楼层
char ch;do {
ch = getchar();
switch(ch) {
case '0':
// deal with input '0'.
break;
case '1':
// deal with input '1'.
break...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行