トップ 差分 一覧 Farm ソース 検索 ヘルプ PDF RSS ログイン

r1-2.c

#include <stdio.h>
int main(void)
{
	int max,min,x,i,j;
	
	scanf("%d",&x);
	min=x;
	max=x;
	if(x==0){
		printf("%d\n",max);
		printf("%d\n",min);
		return(0);
	}
	for(i=0;i>=0;i++){
		scanf("%d",&x);
	
	if(x==0){
		printf("%d\n",max);
		printf("%d\n",min);
		return(0);
	}
	else if(max<x)
	max = x;
	else if(min>x)
	min = x;
	}
	
	return(0);
}