do-while循环判断成绩的有效输入

#include "stdio.h"
void main()
{
    int score;
    do 
    {
        printf("请输入你的成绩(0-100):");
        scanf("%d",&score);
    }while(score<0||score>100);
    printf("你的成绩为:%d",score);
}

 

posted on 2016-11-02 23:45  梁锦杰  阅读(942)  评论(0编辑  收藏  举报

导航

欢迎进入我的博客!