c language number two or number three in the maximum number of

#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;
}

 

Published 15 original articles · won praise 0 · Views 226

Guess you like

Origin blog.csdn.net/qq_44423388/article/details/104259631