阅读背景:

fflush(stdin)在c编程中有什么用

来源:互联网 

I have the following program

我有下面的程序

#include <stdio.h>
#include <stdlib.h>

int main()
{
   char ans[8];
    int i;
    for(i=1;i<=3;i++)
    {
        printf("\n What is the unit of traffic ?");
        scanf("%s",ans);
        fflush(stdin);

        if(stricmp(ans,"Earlang")==0)
        {
            printf("\nAnswer is correct");
            exit(1);
        }
        else
            if(i<3)
            printf("\n Try Again!\n");
    }
    printf("\n Nunit of traffic is Earlang:");
}
#inclu



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: