6-4 to find the largest of two numbers (10 points)

This problem requires two integers a and b, wherein the number of large output.

Function interface definition:

int max( int a, int b );

Wherein a and b are the parameters passed the user, the function returns the larger of the two numbers.

Referee test program Example:

#include <stdio.h>

int max( int a, int b );

int main()
{    
    int a, b;

    scanf("%d %d", &a, &b);
    printf("max = %d\n", max(a, b));

    return 0;
}

/* 你的代码将被嵌在这里 */

Sample input:

-5 8

Sample output:

max = 8

int max( int a, int b )
{
	int x;
	x=a>b?a:b;
	return x;
}
Published 46 original articles · won praise 26 · views 338

Guess you like

Origin blog.csdn.net/Noria107/article/details/104212337