滴水逆向联盟
标题:
基于visual Studio2013解决C语言竞赛题之0602最大值函数
[打印本页]
作者:
大灰狼
时间:
2014-9-18 08:35
标题:
基于visual Studio2013解决C语言竞赛题之0602最大值函数
题目
download.png
(6.78 KB, 下载次数: 1118)
下载附件
保存到相册
2014-9-18 08:35 上传
解决代码及点评
<pre code_snippet_id="91880" snippet_file_name="blog_20131202_1_2646179" class="cpp" name="code"></pre><pre code_snippet_id="91880" snippet_file_name="blog_20131202_1_2646179" class="cpp" name="code"><pre code_snippet_id="91880" snippet_file_name="blog_20131202_1_2646179" class="cpp" name="code"><pre code_snippet_id="91880" snippet_file_name="blog_20131202_1_2646179" class="cpp" name="code">#include <stdio.h>
#include <stdlib.h>
/*
编写一函数求三个整数的最大值。
*/
void f62(int a ,int b,int c)
{
int temp=a; // 取三个数的最大数,先取a
if (temp<b)
{
temp=b; // 如果a比b小,换b
}
if (temp<c)
{
temp=c; // 如果a,b中大的那个比c小,换c
}
printf("最大数是%d\n",temp);
}
void main()
{
int a,b,c;
printf("输入三个整数a,b,c:");
scanf_s("%d%d%d",&a,&b,&c);
f62(a,b,c);
system("pause");
}</pre><br><br></pre></pre>
欢迎光临 滴水逆向联盟 (http://www.dtdebug.com/)
Powered by Discuz! X3.2