| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 314 人关注过本帖
标题:{求助}关于清除缓存的问题
取消只看楼主 加入收藏
ch307458491
Rank: 1
等 级:新手上路
帖 子:27
专家分:2
注 册:2012-10-4
结帖率:75%
收藏
 问题点数:0 回复次数:1 
{求助}关于清除缓存的问题
fflush(stdin)是什么意思    用法是怎么样的  求大神说明一下   另外我刚写了一段代码  运行到开门的时候发现怎么也通不过 ,不知道是为什么#include <stdio.h>
#include <stdlib.h>
/*主函数开始*/
void main ()
{
    /*声明变量*/
    int floor;
    char button;
    /*电梯大门界面*/
    puts("please press e or E to enter the elevator");
    puts("                ------------------------------------");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                ------------------------------------");
            /*进入开门阶段*/
    while(scanf("%c",&button),button!='e' && button!='E')
      {printf("wrong!");/*按键错误 退出*/
             return;
      }
      system("cls");/*成功开门 清屏*/
         
      
      
      
      /*进入电梯内部*/
   
      
      
    puts("pless press the floor number! ");  
    puts("                ------------------------------------");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |||||||||||");
    puts("                |                |                 | ①      |");
    puts("                |                |                 | ②      |");
    puts("                |                |                 | ③      |");
    puts("                |                |                 | ④      |");
    puts("                |                |                 | ⑤      |");
    puts("                |                |                 |      |");
    puts("                |                |                 |      |");
    puts("                |                |                 |||||||||||");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                |                |                 |");
    puts("                ------------------------------------");

   

     /*清除缓存*/
    fflush(stdin);
   
    scanf("%d,&floor");
    switch(floor){
    case'1':
        system("cls");
        puts("it's my home");break;
    case'2':
        system("cls");
        puts("it's my home");break;
    case'3':
        system("cls");
        puts("it's my home");break;
    case'4':
        system("cls");
        puts("it's my home");break;
    case'5':
        system("cls");
        puts("it's my home");
    }


}
搜索更多相关主题的帖子: include button please 
2012-10-05 18:17
ch307458491
Rank: 1
等 级:新手上路
帖 子:27
专家分:2
注 册:2012-10-4
收藏
得分:0 
回复 2楼 w823352417
非常感谢啊  解决了
2012-10-05 20:55
快速回复:{求助}关于清除缓存的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028160 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved