我的第一个小程序调用scanf语句

define _CRT_SECURE_NO_WARNINGS

include<stdio.h>

#include<stdlib.h>
int main(){
int a = 1;
scanf("%d", &a);
if (a < 2){
printf(“你是个傻子\n”);
}
else if (a>2){
printf(“输出错误\n”);
}
else{
printf(“你是个好孩子\n”);
}
system(“pause”);
return 0;
}
按1输出你是个傻子
按2输出你是个好孩子
按大于等于3输出错误

猜你喜欢

转载自blog.csdn.net/qq_43205670/article/details/83388363
今日推荐