#include "stdio.h"
int findmax(int m,int n)
{
return (m>n)?m:n;
}
int main()
{
int m,n;
printf("输入两个整数:");
scanf("%d %d",&m,&n);
printf("最大值为%d\n",findmax(m,n));
return 0;
}
这题目很简单的,即使是大一,也肯定能做出来的,自己平时多看下C语言的书吧
#include
#define FAIL -1
int Func_Cmp(int x, int y)
{
return x > y ? x : y;
}
int main(int argc, char *argv[])
{
int Fir_Num, Sec_Num;
printf("Please input two numbers:");
if (0 == scanf("%d %d", &Fir_Num, &Sec_Num))
{
perror("scanf function error!\n");
exit(FAIL);
}
printf("The bigger number is : %d\n", Func_Cmp(Fir_Num, Sec_Num));
return 0;
}