首页 > 其他 > 详细

C Statements

时间:2015-04-15 13:19:34      阅读:170      评论:0      收藏:0      [点我收藏+]

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

原文:http://www.cnblogs.com/ruiy/p/4428149.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!