在AcWing的第二篇题解^-^
不使用数组和max()函数的一种做法
#include<bits/stdc++.h>
using namespace std;
int main()
{
//先规定max是一个比较小的值,以便进行操作
int max = 0 , x;
//不需要储存读入的三个数,所以不需要存储他们。直接用一个变量x存储每次的输入结果,然后与max比较
//若max < x,即x大于max,则将x的值赋予max即可
for(int i = 0 ; i < 3 ; i++)
{
scanf("%d" , &x);
if(max < x) max = x;
}
//最后输出就好了
printf("%d eh o maior\n" , max);
return 0;
}