编写一个C程序,运行时输人a,b,c三个值,输出其中值最大者

编写一个C程序,运行时输人a,b,c三个值,输出其中值最大者

代码示例:

#include<stdio.h>

int main()
{
	int a, b, c, max;
	printf("请输入三个数:
");

	scanf("%d%d%d", &a, &b, &c);
	if (a > b)
	{
		max = a;
	}
	else
	{
		max = b;
	}

	if (c > max)
	{
		max = c;
	}
	printf("三个数中最大的数为:%d", max);
	return 0;

}

运行截图:

编写一个C程序,运行时输人a,b,c三个值,输出其中值最大者

原文地址:https://www.cnblogs.com/cyuyanchengxu/p/13542765.html