2025-02-21

This commit is contained in:
2025-02-21 20:05:39 +08:00
parent a546c2f47c
commit c7ec5eb71f
@@ -1,27 +1,27 @@
#include <stdio.h> #include <stdio.h>
/* /*
if(条件){ if(){
复合语句(条件为真时执行) (Ϊʱִ)
}else{ }else{
复合语句(条件为假时执行) (Ϊʱִ)
} }
*/ */
int main(void){ int main(void){
int x, y, z, t;//定义三个整型变量 int x, y, z, t;//ͱ
//数据类型 变量名1, 变量名2; // 1, 2;
scanf("%d%d%d", &x, &y, &z); scanf("%d%d%d", &x, &y, &z);
if(x > y){ if(x > y){
t = x; t = x;
x = y; x = y;
y = t; y = t;
}//实现x和y比较 大数放y位置 }//ʵxyȽ
if(y > z){ if(y > z){
t = y; t = y;
y = z; y = z;
z = t; z = t;
}//实现y和z比较 大数放z位置 z为三个数字中最大数 }//ʵyzȽ
if(x > y){ if(x > y){
t = x; t = x;
x = y; x = y;