两数比大小

题目:两数比较大小,使用函数编写。

 1 #include<stdio.h>
 2 #include<stdlib.h>
 3 void main()
 4 {
 5     int max(int x, int y); //max函数声明
 6     int a, b, c;
 7     printf("please input two number:");
 8     scanf("%d,%d", &a, &b);
 9     c = max(a, b);
10     printf("max is %d
", c);
11     system("pause");
12 }
13 
14 int max(int x, int y)
15 {
16     int z;
17     if (x > y) z = x;
18     else z = y;
19     return(z);
20 }

x,y是形参,a,b是实参(实际输入)。

原文地址:https://www.cnblogs.com/gaigaichen/p/7507614.html