if.....else用法

#include<stdio.h>
int main() {
	int age,englishi_score;
	printf("please input your age:\n");
	scanf_s("%d",&age);
	printf("please input your englishi_score:\n");
	scanf_s("%d", &englishi_score);
	if (age >= 18||englishi_score>=100) {
		printf("可以玩");
	}
	else { printf("不可以玩"); }
	return 0;
}
升级版!!!

```c
#include<stdio.h>
int main() {
	int age,englishi_score,IQ;
	printf("please input your age:\n");
	scanf_s("%d",&age);
	printf("please input your englishi_score:\n");
	scanf_s("%d", &englishi_score);
	printf("please input your IQ:\n");
	scanf_s("%d", &IQ);
	if ((age >= 18 && IQ>100||englishi_score>=100)){
		printf("可以玩");
	}
	else { printf("不可以玩"); }
	return 0;
}

上一篇:c语言4-4 对4-6程序进行修改,递减到1而不是0,当输入的值小于0时不进行换行


下一篇:Windows安装Svn客户端