C Statements

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 != ' ')
{
    ;
}

原文地址:https://www.cnblogs.com/ruiy/p/4428149.html