[1] 授業単元: C言語
[2] 問題文(含コード&リンク):
「与えられた2つのプログラムを1つにしなさい」
[3] 環境
 [3.1] OS: XP
 [3.2] コンパイラ名とバージョン: gcc
 [3.3] 言語: C

1つめのプログラム
main()
{
#include <stdio.h>
double max, min, data;
int i, n;
FILE *fp;
if ((fp = fopen ("foobar.txt", \
"r")) == NULL)
{
printf ("file not found");
exit (1);
}
fscanf (fp, "%d", &n);
if (fscanf (fp, "%lf", &data) \
! = EOF)
{
i = 1;
max = data;
min = data;