本实例可以判断一个人成绩大于60通过考试,小于60分未通过考试。
#include <stdio.h>
int main(){
int score;
puts("请输入你的考试成绩:");
scanf("%d",&score);
if(score>60){
printf("your grade is %d\n",score);
printf("pass the exam\n");
}
if(score<60){
printf("your grade is %d\n",score);
printf("don't pass the exam\n");
}
return 0;
}