if 语句

41 阅读1分钟
#include <stdio.h>
int main(){
	// 选择
	int score = 0;
	
	printf("输入一个分数:");
	scanf("%d",&score);
	
	if(score == 100){
		printf("恭喜你 \n");
		printf("100分,出去玩吧! \n");	
	} 	
}

运行结果:

image.png


![image.png](https://p9-xtjj-sign.byteimg.com/tos-cn-i-73owjymdk6/87649c90ea764467bf3d0384ee33ecf0~tplv-73owjymdk6-jj-mark-v1:0:0:0:0:5o6Y6YeR5oqA5pyv56S-5Yy6IEAgb3p5em8=:q75.awebp?rk3s=f64ab15b&x-expires=1771984450&x-signature=2rzC9DHGzqPi8oiNb7A8N9jPtg8%3D)

运行结果:

image.png

image.png

image.png