Submission #20400

# Submission time Handle Problem Language Result Execution time Memory
20400 2017-02-11T01:57:49 Z KEIST(#40, keist99) 채점 시스템 (OJUZ11_judge) C++
Compilation error
0 ms 0 KB
#include<stdio.h>
long long findjari(long long x, long long jari)
{
	if (x==0) return jari;
	return findjari(x/10, jari+1);
}
int main()
{
	long long query;
	scanf("%d", &query);
	while(query--)
	{
		long long correct, score;
		scanf("%lld %lld", &score, &correct);
		
		long long jari=findjari(score, 0);
		if (jari==0) jari++;
		
		long long defaultJari=1;
		for (long long i=1; i<=jari; i++) {
			defaultJari*=10;
		}
		
		long long cnt=0;
		while(1)
		{
			if ((score+defaultJari)>correct) {
				prlong longf("%lld\n", cnt);
				break;
			}
			
			cnt++;
			defaultJari*=10;
		}
	}
	return 0;
}

Compilation message

judge.cpp: In function 'int main()':
judge.cpp:10:20: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
  scanf("%d", &query);
                    ^
judge.cpp:28:5: error: 'prlong' was not declared in this scope
     prlong longf("%lld\n", cnt);
     ^
judge.cpp:10:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &query);
                     ^
judge.cpp:14:39: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld %lld", &score, &correct);
                                       ^