标题:while语句
取消只看楼主
misaluoniqi
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-10-18
 问题点数:0 回复次数:0 
while语句
while(1), break 语句想要暂停一下但是使用system("pause")不管用,每次都是得出结论后直接退出程序了,这样的话应该怎么做呢?如下图
    while (1)
    {
        printf("A enter:");
        sacnf_s("%d", &t);
        i++;
        if (t == n)
        {
            printf("Congratulations playerA is right, he or she spent %d times to guess the correct answer", i);
            system("pause"); 此处system("pause")不管用 ,加至break 后仍然直接跳出
            break;
        }
        else if (t>n)
            printf("This character is too high\n.");
        else
            printf("This character is too low\n.");
        system("pause");
        system("cls");

[此贴子已经被作者于2016-10-18 22:06编辑过]

搜索更多相关主题的帖子: correct system guess 
2016-10-18 21:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-469953-1-1.html




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

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