c语言实现两个数或三个数中的最大数

#include<stdio.h>

int main()
{
	int a = 0, b = 0, c = 0;
	int mid = 0;
	printf("Please input 3 voca:\n");

	scanf_s("%d %d %d", &a, &b, &c);

	int max = a > b ? a : b;//两个数中的最大数
	
	max = max > c ? max : c;//三个数中的最大数
	//mid = max > c ? c : max;//三个数中的中间数

	printf("the max_number is %d ", max);

	return 0;
}
发布了15 篇原创文章 · 获赞 0 · 访问量 226

猜你喜欢

转载自blog.csdn.net/qq_44423388/article/details/104259631
今日推荐