且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C Statements

更新时间:2022-09-13 17:26:13

1,while((ch = getchar()) != EOF)
{
    putchar(ch);
}
2,while((ch=getchar()) != EOF)
{
    if(ch < '0' || ch > '9')
{
    continue;
}
} //process only the digits
3,while(scanf("%f",&value) == 1)
{
    if(value < 0)
{
    break;
    //process the nonnegative
}
}
4,while(scanf("%f",&value) == 1 && value >= 0)
{
    ;
}
5,while((ch = getchar()) != EOF && ch != '\n')
{
    ;
}

C Statements