Submission #20429

#TimeUsernameProblemLanguageResultExecution timeMemory
20429CodingBug (#35)채점 시스템 (OJUZ11_judge)C++98
100 / 100
49 ms2020 KiB
#include <bits/stdc++.h>
using namespace std;
int a,b;

int main(){
//	freopen("input.txt","r",stdin);
	int t;
	scanf("%d",&t);
	while(t--){
		scanf("%d %d",&a,&b);
		if(a==0){
			while(b) b/=10,a++;
			a--;
		}else{
			int k=1e9;
			while(k>b-a) k/=10;
			while(a) k/=10,a/=10;
			while(k) k/=10,a++;
		}
		printf("%d\n",a);
	}
	return 0;
}

Compilation message (stderr)

judge.cpp: In function 'int main()':
judge.cpp:8:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&t);
                ^
judge.cpp:10:23: 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...