Day 01-work
1.写一篇博客 March 18
Day 02-work
1.判断最大值用函数,较大值 March 27
2.代码
int main()
{
////1.求两个较大的数 March 27
//int num1 = 0;
//int num2 = 0;
//printf("请任意输入两个不同整数:\n");
//scanf("%d%d",&num2,&num1);
//if (num1 > num2)
// printf("较大数:%d\n", num1);
//else
// printf("较大数: %d\n", num2); //个人以为可以优化,用for循环多次输入多次比较
//求最大数 March 27
//int num1 = 0;
//int num2 = 0;
//printf("请任意输入两个不同整数:\n");
//scanf("%d%d",&num2,&num1);
//max(num1, num2);
//printf("最大数==%d", max(num1, num2));
return 0;
}
//最大数函数 March 27
int Max(int x, int y)
{
int max = 0;
if (x > y)
{
max = x;
//printf("最大数==%d\n", max);
}
else
{
max = y;
//printf("最大数==%d\n", max);
}
return max;
}