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