Submission #106169

#TimeUsernameProblemLanguageResultExecution timeMemory
106169parkj2180지능형 기차 2 (KOI11_train2)C++14
16 / 16
3 ms384 KiB
#include<stdio.h>
int main() {
	int sum=0, max = 0;
	for (int i = 0; i < 10; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		sum = sum - a + b;
		if (max < sum) max = sum;
	}
	printf("%d", max);
}

Compilation message (stderr)

train.cpp: In function 'int main()':
train.cpp:6:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &a, &b);
   ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...