题目链接:http://ac.jobdu.com/problem.php?pid=1483
解题时间:2013/4/14
程序源码:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
int max,min,temp;
while(scanf("%d",&n)!=EOF)
{
scanf("%d",&temp);
max=min=temp;
n--;
while(n--)
{
scanf("%d",&temp);
max=max>=temp?max:temp;
min=min<=temp?min:temp;
}
printf("%d %d\n",max,min);
}
return 0;
}
本文提供了一个简单的C语言程序来解决JobDu 1483题,该程序能够读取一系列整数并找出其中的最大值和最小值。
442

被折叠的 条评论
为什么被折叠?



