TA的每日心情 | 开心 2014-6-18 08:29 |
---|
签到天数: 14 天 [LV.3]偶尔看看II
滴水大师
 
- 积分
- 2345
|
题目
解决代码及点评
- <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>
|
|