任务和代码
/*
*copyright(c)2017,学院
*All rights reserved.
*文件名称: main.c
*作 者: 杨隆胜
*完成日期: 2017年5月5日
*版 本 号: v1.0
*
*问题描述:输入3个整数,输出其中的最大值;
*输入描述:输入三个整数a,b和c;
*程序输出:输出其中的最大值;
*/
#include <stdio.h>
int main()
{
int a,b,c,m;
printf("Please input the value of three numbers:\n");
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
m=a;
}
else
{
m=b;
}
if(c>m)
{
m=c;
}
printf("The maxmun value of three numbers is:%d\n",m);
return 0;
}
运行结果
心得体会
感觉好像冒泡法,但是不确定是否是,学的编程早就忘了,希望赶紧拾起来。为了梦想,加油!