码迷,mamicode.com
首页 > 其他好文 > 详细

成绩的有效输入

时间:2016-10-28 15:27:24      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:print   std   can   include   void   blog   log   stdio.h   pre   

#include "stdio.h"
void main()
{
    int score;
    printf("请输入你的成绩:");
    scanf("%d",&score);
    for (score;score<=100;score++)
    {
        if(score<0||score>100)
        {
            printf("您输入有误,请重新输入");
        }else break;
        printf("%d",score);
    }
}

 

成绩的有效输入

标签:print   std   can   include   void   blog   log   stdio.h   pre   

原文地址:http://www.cnblogs.com/liangjinjie/p/6007905.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!