编写一个c程序 输入a b c三个值,输入其中最大者。

2016-06-15 10:45:37  分类: c程序设计第四版谭浩强课后答案  参与:

 编写一个c程序 输入a b c三个值,输入其中最大者。

 

【c源程序答案】
#include <stdio.h>
int main()
{int a,b,c,max;
 printf("please input a,b,c:\n");
 scanf("%d,%d,%d",&a,&b,&c);
 max=a;
 if (max<b)
   max=b;
 if (max<c)
   max=c;
 printf("The largest number is %d\n",max);
 return 0;
}

来源:c程序设计第四版谭浩强课后答案

本文链接:http://www.wb98.com/c/post/tanhaoqiang_1.6.html

本站文章搜索:

<< 上一篇下一篇 >>

搜索

网站分类

Tags列表

赞助商链接