C Statements

时间:2023-03-08 19:03:45

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