任务和代码
/*
*Copyright (c)2015,CSDN学院
*All rights reserved.
*文件名称:main.c
*作 者:高源秀
*完成日期:2015年10月10日
*版 本 号:v1.0
*
*问题描述:比较三个数的大小
*程序输出:输出最大一个数。
*/
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,t;
scanf("%d %d %d",&a,&b,&c);
if(a<b)
{
t=a;
a=b;
b=t;
}
if(a<c)
{
t=a;
a=c;
c=t;
}
printf("the max is:%d\n",a);
return 0;
}
运行结果
知识点总结
通过这个程序,我会用条件判断数字的大小
心得
调试程序很顺利 中间没有出现差错