답안 #20215

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
20215 2016-04-12T23:41:54 Z jjyoonki 지능형 기차 2 (KOI11_train2) C
16 / 16
1 ms 0 KB
#include <stdio.h>

int main(void) {
	int a, b, n;
	int s, smax;

	s = 0;
	smax = 0;
	for( n=0 ; n<10 ; n++ ){
		scanf( "%d %d", &a, &b );
		s += (b-a);
		if( smax<s )
			smax = s;
	}
	printf( "%d\n", smax );

	return 0;
}

Compilation message

train.c: In function 'main':
train.c:10:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   scanf( "%d %d", &a, &b );
   ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 0 KB Output is correct
2 Correct 1 ms 0 KB Output is correct
3 Correct 1 ms 0 KB Output is correct
4 Correct 1 ms 0 KB Output is correct
5 Correct 1 ms 0 KB Output is correct
6 Correct 1 ms 0 KB Output is correct
7 Correct 1 ms 0 KB Output is correct
8 Correct 1 ms 0 KB Output is correct
9 Correct 1 ms 0 KB Output is correct
10 Correct 1 ms 0 KB Output is correct