1.为什么我在写找最大值的程序时,如果没有对ABC进行赋值,为什么编译结果是1

2.对ABC进行赋值,编译结果是赋值的那个数字,怎么样把那个编译结果改成a或者b或者c

1.为什么我在写找最大值的程序时,如果没有对ABC进行赋值,为什么编译结果是1

2.对ABC进行赋值,编译结果是赋值的那个数字,怎么样把那个编译结果改成a或者b或者c

第一图里,a b c 未赋值,a b c 都是随机值,所以经过比较那段代码后,输出是啥完全随机。
第二图:最后加三个判断语句:
if(max == a) printf("The max is a");
if(max == b) printf("The max is b");
if(max == c) printf("The max is c");
供参考:
#include <stdio.h>
int main()
{
int a = 5;
int b = 8;
int c = 1;
int max = 0;
//scanf("%d %d %d", &a, &b, &c);
if (a > b)
if (a > c)
max = a;
else
max = c;
else
if (b > c)
max = b;
else
max = c;
if (max == a) printf("The max is a");
if (max == b) printf("The max is b");
if (max == c) printf("The max is c");
return 0;
}