submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s616578769
p00002
C++
#include <stdio.h> int ketasu(int atai){ int result = 0; for(atai != 0){ result++; atai = atai / 10; } return result; } int main(){ int a, b; while(scanf("%d %d",&a, &b) != -1) printf("%d\n", ketasu(a + b)); return 0; }
a.cc: In function 'int ketasu(int)': a.cc:4:22: error: expected ';' before ')' token 4 | for(atai != 0){ | ^ | ; a.cc:8:9: error: expected primary-expression before 'return' 8 | return result; | ^~~~~~ a.cc:7:10: error: expected...
s984094632
p00002
C++
// aoj-1002.c #include <stdio.h> int main() { int a, b, temp; while(scanf("%d %d", &a, &b) != EOF) { printf("%d\n", sprintf(temp, "%d", a+b)); } return 0; }
a.cc: In function 'int main()': a.cc:9:40: error: invalid conversion from 'int' to 'char*' [-fpermissive] 9 | printf("%d\n", sprintf(temp, "%d", a+b)); | ^~~~ | | | ...
s223126587
p00002
C++
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ int n= sc.nextInt(); int o= sc.nextInt(); int wa = n+o; System.out.println(sum(wa)); } sc.close(); } static int sum(int n){ int i=1; int t=10; while(n>=t){ ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:15: error: expected ':' before 'static' 4 | public static void main(String args[]){ | ^~~~~~~ | : a.cc:4:...
s645439834
p00002
C++
include <iostream> using namespace std; int main(){ int a,b,cnt=1,i,j=10; while(cin>>a>>b){ int add=a+b; while(1){ i = add - j; if(i>=0)cnt++; else break; j *= 10; } cout << cnt << endl; } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:7:11: error: 'cin' was not declared in this scope 7 | while(cin>>a>>b){ | ^~~ a.cc:15:9: error: 'cout' was not declared in this scope 15 | cout << cnt << end...
s234841898
p00002
C++
#include <stdio.h> #include <string.h> int main() { long long int m,n; int i; while(scanf("%lld %lld",&m,&n != EOF)) { m += n; i = 0; while(m) { i++; m /= 10; } printf("%d\n",i); } }
a.cc: In function 'int main()': a.cc:8:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | while(scanf("%lld %lld",&m,&n != EOF)) | ^
s224143232
p00002
C++
#include<cstdio> #include<cmath> int main(){ int a,b; while(scanf_s("%d %d",&a,&b) != EOF) printf_s("%d\n",(int)log10((double)a+b)+1); }
a.cc: In function 'int main()': a.cc:6:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 6 | while(scanf_s("%d %d",&a,&b) != EOF) | ^~~~~~~ | scanf a.cc:7:17: error: 'printf_s' was not declared in this scope; did you mean 'printf'? 7 | ...
s634789796
p00002
C++
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> #include <ctime> using namespace std; int main() { char buf[2000]; int a,b,c; while(fgets(buf,sizeof(buf),stdin)!=NULL){ c=1; a=atoi(strtok(buf," ")); b=atoi(strtok(NULL,"\n")); a+=b; while(a/=10...
a.cc: In function 'int main()': a.cc:18:24: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 18 | a=atoi(strtok(buf," ")); b=atoi(strtok(NULL,"\n")); | ^~~~~~ | strtoq
s746310467
p00002
C++
#include <iostream> #include <cstdio> using namespace std; int main(){ int a, b; char s[100]; while(cin >> a >> b){ a += b; sprintf(s, "%d", a); cout << strlen(s) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: 'strlen' was not declared in this scope 10 | cout << strlen(s) << endl; | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstr...
s394143989
p00002
C++
#include <iostream> int main(void){ while (!std::cin.eof()){ int a,b,c,i; std::cin >> a >> b; c=a+b; while(!(c/=10)) i++; std::cout << i << std::endl; }
a.cc: In function 'int main()': a.cc:13:2: error: expected '}' at end of input 13 | } | ^ a.cc:3:15: note: to match this '{' 3 | int main(void){ | ^
s713971820
p00002
C++
#include<cstdio> #include<vector> using namespace std; int main(){ int a,b; while(scanf("%d %d",&a,&b)!=EOF){ vector<char> c(255); printf("%d\n",sprintf(c,"%d",a+b)); } return 0; }
a.cc: In function 'int main()': a.cc:8:39: error: cannot convert 'std::vector<char>' to 'char*' 8 | printf("%d\n",sprintf(c,"%d",a+b)); | ^ | | | std::vector<char> In f...
s038228490
p00002
C++
#include<cstdio> #include<string> using namespace std; int main(){ int a,b; while(scanf("%d %d",&a,&b)!=EOF){ string c[255]; printf("%d\n",sprintf(c,"%d",a+b)); } return 0; }
a.cc: In function 'int main()': a.cc:8:39: error: cannot convert 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'char*' 8 | printf("%d\n",sprintf(c,"%d",a+b)); | ^ | | | ...
s438641980
p00002
C++
#include<cstdio.h> int main() { while(true) { int a,b; scanf("%d %d",&a,&b); if(a==EOF || b==EOF) break; int temp=a+b; int ans=1; while((temp/=10)>=10) { ans++; } printf("%d\n",ans); } }
a.cc:1:9: fatal error: cstdio.h: No such file or directory 1 | #include<cstdio.h> | ^~~~~~~~~~ compilation terminated.
s917397071
p00002
C++
#include<iostream> int main() { int a, b; while( std::cin >> a >> b ){ std::cout << 1 + (int)log10( a + b ) << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:39: error: 'log10' was not declared in this scope 7 | std::cout << 1 + (int)log10( a + b ) << std::endl; | ^~~~~
s689927043
p00002
C++
#include <iostream> using namespace std; int main() { int a,b,c=0,d; while(cin>>a>>b) { a+=b; while(a) { c++; a/=b; } cout<<c<<endl; return 0; }
a.cc: In function 'int main()': a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s133730120
p00002
C++
a,b=gets.split.map(&:to_i);p (a+b).to_s.length
a.cc:1:1: error: 'a' does not name a type 1 | a,b=gets.split.map(&:to_i);p (a+b).to_s.length | ^ a.cc:1:30: error: expected constructor, destructor, or type conversion before '(' token 1 | a,b=gets.split.map(&:to_i);p (a+b).to_s.length | ^
s513818619
p00002
C++
#include<iostream> using namespace std; int main(){ const int INF=10000000; int a,b,c,ans; while(cin>>a>>b){ ans=1; a+=b; for(i=0;i<INF;i++){ c=a%10 a-=c if(a=0){break;} if(a!=0){ ans++; a/=10;}} cout<<ans;}}
a.cc: In function 'int main()': a.cc:10:5: error: 'i' was not declared in this scope 10 | for(i=0;i<INF;i++){ | ^ a.cc:11:7: error: expected ';' before 'a' 11 | c=a%10 | ^ | ; 12 | a-=c | ~
s873760637
p00002
C++
#include <stdio.h> #include <string.h> int main() { int IsB = 0,i = 0; char a[20],b[20],*digits; while(1){ char str; scanf("%c",&str); if(str == EOF)break; if(str == ' '){ i = 0; IsB = 1; }else if(str == '\n'){ sprintf(digits,"%d",...
a.cc: In function 'int main()': a.cc:16:33: error: 'atoi' was not declared in this scope 16 | sprintf(digits,"%d",atoi(a) + atoi(b)); | ^~~~
s642392933
p00002
C++
#include <stdio.h> #include <string.h> int main() { int IsB = 0,i = 0; char a[100],b[100],*digits; while(1){ char str = '\0'; scanf("%c",&str); if(str == '\0')break; if(str == ' '){ i = 0; IsB = 1; }else if(str == '\n'){ sprintf(di...
a.cc: In function 'int main()': a.cc:16:33: error: 'atoi' was not declared in this scope 16 | sprintf(digits,"%d",atoi(a) + atoi(b)); | ^~~~
s174136940
p00002
C++
int a; int b; int ans; while(cin >> a >> b){ ans = a + b; if(ans>=0 && ans<=99){ cout << "2" <<endl; } else if(ans>=100 && ans<=999){ cout << "3" <<endl; } else if(ans>=1000 && ans<=1999){ cout << "4" <<endl; } } return 0; }
a.cc:4:3: error: expected unqualified-id before 'while' 4 | while(cin >> a >> b){ | ^~~~~ a.cc:16:3: error: expected unqualified-id before 'return' 16 | return 0; | ^~~~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s196807995
p00002
C++
#include<iostream> using namespace std; int main(){ int m; int m1=0,m2=0,m3=0; for(int i=0;i<10i++){ cin << m << endl; if(m1>m){ m3 = m2; m2 = m1; m1 = m; } else if(m2>m){ m3 = m2; m2 = m; } else if(m3>m){ m3 = m; } } cout << m1 << e...
a.cc: In function 'int main()': a.cc:6:20: error: lvalue required as increment operand 6 | for(int i=0;i<10i++){ | ^~ a.cc:6:22: error: expected ';' before ')' token 6 | for(int i=0;i<10i++){ | ^ | ; a.cc:7:9: error: no match for...
s555394973
p00002
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int main() { int a, b; while(cin >> a >> b) { char buff[100]; sprintf(buff, "%d", a+b); cout << strlen(buff) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:13: error: 'strlen' was not declared in this scope 11 | cout << strlen(buff) << endl; | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <c...
s892425929
p00002
C++
#include<iostream> #include<cmath> int main(){ int a,b; while(cin >> a >> b){ std::cout << log10(a+b)+1<< std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | while(cin >> a >> b){ | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ...
s810059962
p00002
C++
while True: try: a, b = raw_input().strip().split(" ") print len(str(int(a) + int(b))) except: break;
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while True: | ^~~~~
s834943930
p00002
C++
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.IO; class ListOfTopThreeHills { static void Main(string[] args) { do { string input = Console.ReadLine(); if (string.IsNullOrEmpty(input)) { break; } string[] inputArr = input...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Collectio...
s757127472
p00002
C++
#include <math> #include <cstdio> using namespace std; int main() { int a, b; while(scanf("%d %d", &a, &b) != EOF){ printf("%d\n", log10(a+b)); } return 0; }
a.cc:1:10: fatal error: math: No such file or directory 1 | #include <math> | ^~~~~~ compilation terminated.
s810422215
p00002
C++
#include <cstdio> #include <string> int main() { int ch; int a, b; char str[255]; ch = 0; while (ch != EOF) { scanf("%d %d", &a, &b); sprintf(str, "%d", a + b); printf("%d\n", strlen(str)); ch = getchar(); } }
a.cc: In function 'int main()': a.cc:12:26: error: 'strlen' was not declared in this scope 12 | printf("%d\n", strlen(str)); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <string> ...
s823133286
p00002
C++
#include <cstdio> #include <string> int main() { int ch; int a, b; char str[255]; ch = 0; while (ch != EOF) { scanf("%d %d", &a, &b); sprintf(str, "%d", a + b); b = strlen(str); printf("%d\n", b); ch = getchar(); } }
a.cc: In function 'int main()': a.cc:12:15: error: 'strlen' was not declared in this scope 12 | b = strlen(str); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <string> +++ |+#include <cstrin...
s542077416
p00002
C++
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main(){ int a,b; char s1[20]; while(gets(s1))!=EOF{ int len=strlen(s1)-1; printf("%d\n",len); fflush(stdin); fflush(stdout); } return 0; }
a.cc: In function 'int main()': a.cc:9:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | while(gets(s1))!=EOF{ | ^~~~ | getw a.cc:9:20: error: expected primary-expression before '!=' token 9 | while(gets(s1))!=EOF{ | ^~
s028676728
p00002
C++
#include <iostream> using namespace std; int main(){ cin>> a b; int c = a + b; int d = 0; while(c!=0){ c/=10; d++; } cout<<d<<endl; return 0; }
a.cc: In function 'int main()': a.cc:4:7: error: 'a' was not declared in this scope 4 | cin>> a b; | ^ a.cc:5:13: error: 'b' was not declared in this scope 5 | int c = a + b; | ^
s720442445
p00002
C++
while line = gets do p ->(l){(l[0]+l[1]).to_s.size}.call line.split(' ').map(&:to_i) end
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while line = gets do | ^~~~~ a.cc:2:35: error: expected unqualified-id before '.' token 2 | p ->(l){(l[0]+l[1]).to_s.size}.call line.split(' ').map(&:to_i) | ^
s061097316
p00002
C++
#include <iostream> using namespace std; void main(){ int a,b,c,d=0; cin>>a>>b; c=a+b; while(c>0){ c/=10; d++; } cout<<d; }
a.cc:4:1: error: '::main' must return 'int' 4 | void main(){ | ^~~~
s315468159
p00002
C++
#include <iostream> using namespace std; int main(){ int a,b,c=0; while(cin>>a>>b) a+=b;c=0; while(a>0){ a/=10;c++; } cout<<c<<endl; } return 0; }
a.cc:13:1: error: expected unqualified-id before 'return' 13 | return 0; | ^~~~~~ a.cc:14:1: error: expected declaration before '}' token 14 | } | ^
s941598066
p00002
C++
#include <iostream> #include <iomanip> #include <stdio.h> using namespace std; double* solve_equations(int *a) { // クラメルの公式を用いる int data_size=sizeof(a[0]); /*cout << "data_size=" << data_size << endl; cout << "a=" << a << endl; cout << "*(a + data_size*1)=" << *(a + 1) << endl; cout << "*(a + data_size*0) * *(a ...
a.cc: In function 'double* solve_equations(int*)': a.cc:23:14: error: 'pow' was not declared in this scope 23 | ax = pow(z,-1)*x; | ^~~ a.cc:29:16: warning: address of local variable 'ans' returned [-Wreturn-local-addr] 29 | return ans; | ^~~ a.cc:28:16: not...
s530346394
p00002
C++
#include <iostream> #include <cstring> #include <cstdlib> using namespace std; int main(){ int a,b; while (cin >> a >> b){ int l = a+b; char n[50]; itoa(l,n,10); cout << strlen(n) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'itoa' was not declared in this scope 13 | itoa(l,n,10); | ^~~~
s385537753
p00002
C++
#include <iostream> //#include <cstring> #include <cstdio> using namespace std; int main(){ int a,b; while (cin >> a >> b){ int l = a+b; char n[50]; l=sprintf (n,"%d",a+b); cout << l << endl; } return 0; } }
a.cc:19:9: error: expected declaration before '}' token 19 | } | ^
s852115557
p00002
C++
5 7 1 99 1000 999
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 7 | ^
s214970631
p00002
C++
#include <iostream> using namespace std; int main(){ int n, m, dig; while(cin >> n >> m){ n += m; while(n){ sum /= 10; dig++; } cout << dig << endl; } }
a.cc: In function 'int main()': a.cc:10:13: error: 'sum' was not declared in this scope 10 | sum /= 10; | ^~~
s056800997
p00002
C++
#include <stdio.h> int digit( x ); int main(){ int a, b; int x; while( scanf("%d %d", &a, &b) != EOF){ x = digit( a+b ); printf("%d\n", x); } return 0; } int digit( x ){ int c=1; while( (x / 10) != 0){ x /= 10; c++; } return c; }
a.cc:3:12: error: 'x' was not declared in this scope 3 | int digit( x ); | ^ a.cc: In function 'int main()': a.cc:10:14: error: 'digit' cannot be used as a function 10 | x = digit( a+b ); | ~~~~~^~~~~~~ a.cc: At global scope: a.cc:16:5: error: redefinition of 'int digit' 16 ...
s991219302
p00002
C++
#include <stdio.h> //int digit( x ); int digit( x ){ int c=1; while( (x / 10) != 0){ x /= 10; c++; } return c; } int main(){ int a, b; int x; while( scanf("%d %d", &a, &b) != EOF){ x = digit( a+b ); printf("%d\n", x); } return 0; }
a.cc:4:12: error: 'x' was not declared in this scope 4 | int digit( x ){ | ^ a.cc: In function 'int main()': a.cc:17:14: error: 'digit' cannot be used as a function 17 | x = digit( a+b ); | ~~~~~^~~~~~~
s724880019
p00002
C++
#include<iostream> int main(){ int a,b; std::cin>>a>>b; int c=a+b; if(c/1000000>=1)std::cout<<7<<std::endl; else if(c/100000>=1)std::cout<<6<<std::endl; else if(c/10000>=1)std::cout<<5<<std::endl; else if(c/1000>=1)std::cout<<4<<std::endl; else if(c/100>=1)std::cout<<3<<std::endl; else if(c/10>=1)std::cout<<2<...
a.cc: In function 'int main()': a.cc:11:48: error: expected ';' before 'else' 11 | else if(c/10>=1)std::cout<<2<<std::endl | ^ | ; 12 | else std::cout<<1<<std::endl; | ~~~~ ...
s727019955
p00002
C++
#include <iostream> #include <math.h> using namespace std; int main() { //変数の宣言 int a,b,sum,i=0; /////メイン処理///// while(cin>>a>>b){ //入力 sum = a + b; //桁数の計算 while(1){ if (pow(10,i)<=sum && pow(10,i+1) > sum){ cout << i+1 <<endl; break; } i++; } i = 0 } return 0; }
a.cc: In function 'int main()': a.cc:31:22: error: expected ';' before '}' token 31 | i = 0 | ^ | ; 32 | } | ~
s231802262
p00002
C++
#include<iostream> #include<stdio.h> using namespace std; int main(){ int num1,num2; char str[10]; int i; // 値の入力 cin >> num1 >> num2; //整形 sprintf_s(str,"%d\0",(num1 + num2)); // 文字数計測 for(i=0;str[i] != '\0';i++){ } // 文字数表示 cout << i << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:9: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'? 15 | sprintf_s(str,"%d\0",(num1 + num2)); | ^~~~~~~~~ | sprintf
s313594204
p00002
C++
#include<iostream> #include<stdio.h> using namespace std; int main(){ int num1,num2; char str[10]; int i; while(1){ // 値の入力 cin >> num1 >> num2; //整形 sprintf_s(str,"%d\0",(num1 + num2)); // 文字数計測 for(i=0;str[i] != '\0';i++){ } // 文字数表示 cout << i << endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:9: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'? 17 | sprintf_s(str,"%d\0",(num1 + num2)); | ^~~~~~~~~ | sprintf
s666852359
p00002
C++
#include<iostream> #include<stdio.h> #define MAX_NUMBER 200 using namespace std; int main(){ int num1,num2; char str[10]; int i; while(cin >> num1 >> num2){ //整形 sprintf_s(str,"%d\0",(num1 + num2)); // 文字数計測 for(i=0;str[i] != '\0';i++){ } // 文字数表示 cout << i << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:17: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'? 15 | sprintf_s(str,"%d\0",(num1 + num2)); | ^~~~~~~~~ | sprintf
s389657721
p00002
C++
#include <iostream> using namespace std; int main() { int a,b,c,d; c=a+b; if(a<=1000000&&b<=1000000){ for(int i=0;i<200;i++){ for(int j=0;j<8;j++){ d=c/10; if(d<1){ cout<<j+1<<endl;} else { break; } } } return 0; }
a.cc: In function 'int main()': a.cc:19:10: error: expected '}' at end of input 19 | } | ^ a.cc:4:20: note: to match this '{' 4 | int main() { | ^
s892650214
p00002
C++
#include<cstdio> int main(){for(int a,b;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(char* &a,"%d",a+b)));}
a.cc: In function 'int main()': a.cc:2:67: error: expected primary-expression before 'char' 2 | int main(){for(int a,b;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(char* &a,"%d",a+b)));} | ^~~~
s949818759
p00002
C++
#include <iostream> #include <cmath> using namespace std; int main() { int a,b; while(cin >> a >> b) cout << log10(a+b) + 1; << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:9:33: error: expected primary-expression before '<<' token 9 | cout << log10(a+b) + 1; << '\n'; | ^~
s506398545
p00002
C++
#include<stdioi.h> int main(void) { int a,b,i,sum; while(scanf("%d %d",&a,&b)!=EOF) { sum=a+b; i=0; while(sum>0) { sum=sum/10; i++; } printf("%d\n",i); } return 0; }
a.cc:1:9: fatal error: stdioi.h: No such file or directory 1 | #include<stdioi.h> | ^~~~~~~~~~ compilation terminated.
s220625516
p00002
C++
#include <iostream> int main(){ int cnt; while(std::cin>>a>>b){ for(int i=10,cnt=0;;i*=10,cnt++){ if((a+b)/i==0){ std::cout<<cnt<<'\n'; break; } } } return 0; }
a.cc: In function 'int main()': a.cc:5:25: error: 'a' was not declared in this scope 5 | while(std::cin>>a>>b){ | ^ a.cc:5:28: error: 'b' was not declared in this scope 5 | while(std::cin>>a>>b){ | ^
s712955218
p00002
C++
main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x/=10;i++);printf("%d\n",i);}
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x/=10;i++);printf("%d\n",i);} | ^
s609740418
p00002
C++
main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);}
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);} | ^
s795899702
p00002
C++
main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);}
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);} | ^
s877584332
p00002
C++
main(a,b,i,x){for(;scanf("%d%d",&a,&b)!=-1;){for(x=a+b,i=1;x=x/10;i++);printf("%d\n",i);}}
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(a,b,i,x){for(;scanf("%d%d",&a,&b)!=-1;){for(x=a+b,i=1;x=x/10;i++);printf("%d\n",i);}} | ^
s144250785
p00002
C++
import java.io.*; class Main { public static void main(String args[]) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String s[], t; int i, j, ans, l, m; boolean flag = false; while((t = reader.readLine()) != null) { s = t.split(" "); i = s[0].length()-1 ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:15: error: expected ':' before 'static' 4 | public static void main(String args[]) { | ^~~~~~~ | : a.cc:4:3...
s585815734
p00002
C++
#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { long long int num,a,b,sum,i,j,k,len; char str[1000],ch[1000]; while(scanf("%lld %lld",&a,&b)==2) { sum=a+b; itoa(sum,str,10); len=strlen(str); printf("%lld\n",len); } return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'itoa' was not declared in this scope 12 | itoa(sum,str,10); | ^~~~
s807094163
p00002
C++
package aoj.q0002; // 投稿時に削除 public class Main { public static void Main(String[] args) { int a =342; int b =652; int X =a+b; int keta = Integer.toString(X).length(); while(0<X){ X/= 10; } System.out.println(keta+1); } }
a.cc:1:1: error: 'package' does not name a type 1 | package aoj.q0002; // 投稿時に削除 | ^~~~~~~ a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s261027404
p00002
C++
#include<iostream> int main(){ for(int k=0;k<200;k++){ int i,j; cin >> i >> j; cout << i+j << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> i >> j; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to stan...
s310452483
p00002
C++
#include <iostream> #include <conio.h> using namespace std ; int datas[2][200] ; int datanum ; int sum[200] ; int solve[200] ; int main() { cin >> datanum ; for( int i = 0 ; i < datanum ; i ++ ) { cin >> datas[0][i] ; cin >> datas[1][i] ; sum[i] = datas[0][i] + datas[1][i] ; } for( int i = 0 ; i < data...
a.cc:2:10: fatal error: conio.h: No such file or directory 2 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s512145291
p00002
C++
#include<iostream> #include<cstdio> using namespace std; int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF) { int x=a+b; int cnt=0; while(x) { cnt++; x/=10; } printf("%d\n",cnt); } return 0; }
a.cc:2:18: warning: extra tokens at end of #include directive 2 | #include<cstdio> using namespace std; int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF) { int x=a+b; int cnt=0; while(x) { cnt++; x/=10; } printf("%d\n",cnt); } return 0; } | ^~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu...
s464492745
p00002
C++
#include<iostream> int main(){ int a,b; while(std::cin>>a>>b) a=log10(a+b)+1,std::cout<<a<<std::endl; return 0; }
a.cc: In function 'int main()': a.cc:5:19: error: 'log10' was not declared in this scope 5 | a=log10(a+b)+1,std::cout<<a<<std::endl; | ^~~~~
s752111522
p00002
C++
#include<iostream> int main(){ int a,b; while(std::cin>>a>>b){ a=log10(a+b)+1; std::cout<<a<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:18: error: 'log10' was not declared in this scope 5 | a=log10(a+b)+1; | ^~~~~
s104733323
p00002
C++
#include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <string> #include <cstdio> using namespace std; int main() { int m,n; while(cin>>m>>n) cout<<ceil(log10((double)(m+n+1)))<<endl; getchar(); return 0; }
a.cc: In function 'int main()': a.cc:12:28: error: 'log10' was not declared in this scope 12 | cout<<ceil(log10((double)(m+n+1)))<<endl; | ^~~~~ a.cc:12:23: error: 'ceil' was not declared in this scope 12 | cout<<ceil(log10((double)(m+n+1)))<<endl; ...
s102494963
p00002
C++
#include <iostream> using namespace std; int main() { int n1,n2; cin>> n1; cin>> n2; int sum; sum= n1 + n2; while(sum) { int d; int count= 0; d= sum % 10; count++; sum= sum / 10; } cout<<count<<endl; }
a.cc: In function 'int main()': a.cc:21:12: error: 'count' was not declared in this scope 21 | cout<<count<<endl; | ^~~~~
s695342832
p00002
C++
#include<iostream> using namespace std; int main(){ int a, b; while (cin >> a >> b){ cout << (int)(log10((double)(a + b)) + 1)<< '\n'; } return 0; }
a.cc: In function 'int main()': a.cc:7:31: error: 'log10' was not declared in this scope 7 | cout << (int)(log10((double)(a + b)) + 1)<< '\n'; | ^~~~~
s521965473
p00002
C++
#include<cstdio> using namespace std; int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF){ int x=a+b; for(int i=0;i<8;i++){ if(x<(1ei) printf("%d\n",i); } } return 0; }
a.cc:9:7: error: exponent has no digits 9 | if(x<(1ei) printf("%d\n",i); | ^~~ a.cc: In function 'int main()': a.cc:10:1: error: expected primary-expression before '}' token 10 | } | ^ a.cc:9:29: error: expected ')' before '}' token 9 | if(x<(1ei) printf("%d\n",i); | ~ ...
s601039269
p00002
C++
#include<cstdio> using namespace std; int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF){ int x=a+b; for(int i=0;i<8;i++){ if(x<(1ei)){ printf("%d\n",i);} } } return 0; }
a.cc:9:7: error: exponent has no digits 9 | if(x<(1ei)){ printf("%d\n",i);} | ^~~
s014997142
p00002
C++
#include<cstdio> using namespace std; int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF){ int x=a+b; for(int i=0;i<8;i++){ if(x<(1ei))printf("%d\n",i); } } return 0; }
a.cc:9:7: error: exponent has no digits 9 | if(x<(1ei))printf("%d\n",i); | ^~~
s849674868
p00002
C++
#include<iostream> using namespace std; int main() { int a, b; while (scanf_s("%d%d",&a,&b)!= EOF) { int l=1; int k = a + b; while (k / 10) { l++; k /= 10; } cout << l << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 6 | while (scanf_s("%d%d",&a,&b)!= EOF) | ^~~~~~~ | scanf
s411769636
p00002
C++
#include <iostream> using namespace std; int main() { int a,b,sum,digit; while(cin << a << b){ digit = 0; sum = a + b; while(sum > 0){ sum /= 10; digit += 1; } cout << digit << endl; } }
a.cc: In function 'int main()': a.cc:7:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | while(cin << a << b){ | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char...
s805482866
p00002
C++
#include <iostream> using namespace std; int main() { int a,b,sum,digit; while(cin << a << b){ digit = 0; sum = a + b; while(sum > 0){ sum /= 10; digit += 1; } cout << digit << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | while(cin << a << b){ | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char...
s624524009
p00002
C++
#include<iostream> #include<cstdlib> #include<string> using namespace std; int main() { int a, b; string s; char sp[8]; while(cin >> a >> b) { itoa(a + b, sp, 10); s = sp; cout << s.size() << endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: 'itoa' was not declared in this scope 14 | itoa(a + b, sp, 10); | ^~~~
s014803271
p00002
C++
#include <stdio.h> int main( void ){ int a,b; scanf( "%d %d",&a,&b ); a = a + b; int n = 1; int j = 0; while( a / n > 0 ){ n *= 10; j++; } printf( "%d",j );
a.cc: In function 'int main()': a.cc:15:22: error: expected '}' at end of input 15 | printf( "%d",j ); | ^ a.cc:3:17: note: to match this '{' 3 | int main( void ){ | ^
s532709959
p00002
C++
#include <stdio.h> int main( void ){ do{ int a,b; scanf( "%d %d",&a,&b ); a = a + b; int n = 1; int j = 0; while( true ){ if( a / n >= 1 ) n *= 10; else break; j++; } printf( "%d",j ); }while( l < 200;l++ ); return 0; }
a.cc: In function 'int main()': a.cc:15:9: error: 'l' was not declared in this scope 15 | }while( l < 200;l++ ); | ^ a.cc:15:16: error: expected ')' before ';' token 15 | }while( l < 200;l++ ); | ~ ^ | )
s954704903
p00002
C++
#include <stdio.h>int main( void ){ int l = 0; do{ int a,b; scanf( "%d %d",&a,&b ); a = a + b; int n = 1; int j = 0; while( true ){ if( a / n >= 1 ) n *= 10; else break; j++; } printf( "%d",j ); }while( l < 200;l++ ); return 0;...
a.cc:1:23: warning: extra tokens at end of #include directive 1 | #include <stdio.h>int main( void ){ | ^~~~ a.cc:1:10: fatal error: stdio.h>in: No such file or directory 1 | #include <stdio.h>int main( void ){ | ^~~~~~~~~~~~ compilation terminated.
s751714409
p00002
C++
#include <stdio.h>int main( void ){ int l = 0; while( l < 200 ) int a,b; scanf( "%d %d",&a,&b ); a = a + b; int n = 1; int j = 0; while( true ){ if( a / n >= 1 ) n *= 10; else break; j++; } printf( "%d",j ); l++; }return 0;}
a.cc:1:23: warning: extra tokens at end of #include directive 1 | #include <stdio.h>int main( void ){ | ^~~~ a.cc:1:10: fatal error: stdio.h>in: No such file or directory 1 | #include <stdio.h>int main( void ){ | ^~~~~~~~~~~~ compilation terminated.
s071415840
p00002
C++
#include<stdio.h> #include<string.h> int main(void) { long int a,b,c,d; char bb[7]; while((scanf("%d %d",&a,&b))==2) { c= a+b; itoa(c,bb,10); d = strlen(bb); printf("%d\n",d); } return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'itoa' was not declared in this scope 10 | itoa(c,bb,10); | ^~~~
s749343009
p00002
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <string> using namespace std; int main(){ int a, b, c, s; while(cin >> a >> b){ c = 1; s = a + b; while(s = s / 10, s){ c++; } cout << c << "\n"; } return 0;
a.cc: In function 'int main()': a.cc:18:18: error: expected '}' at end of input 18 | return 0; | ^ a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s032539396
p00002
C++
mergesort(A[],B[]) { i=0,j=0; while i<=l1 && j<=l2 { if A[i]<B[j] then C.push(A[i]);i++; else C.push(B[j]);j++; } if (i<l1) while(i<=l1) C.push(A[i++]); if (j<l2) while(j<=l2) C.push(B[j++]); }
a.cc:1:10: error: expected constructor, destructor, or type conversion before '(' token 1 | mergesort(A[],B[]) | ^
s755703072
p00002
C++
#include <stdio.h> int main(){ int a=0,b=0; while (scanf("%d%d", &a, &b)!=EOF){ if (a + b < 1000000){ printf("6\n"); }else if(a + b < 100000){ printf("5\n"); }else if (a + b < 10000){ printf("4\n"); }else if (a + b < 1000){ printf("3\n"); }else if (a + b < 100){ printf("2\n"); }else ...
a.cc: In function 'int main()': a.cc:20:38: error: 'x' was not declared in this scope 20 | printf("1\n",x); | ^ a.cc:24:1: error: '\U0000ff5d' was not declared in this scope 24 | } | ^~ a.cc:24:3: error: expected '}' at end of input 24 | ...
s430376492
p00002
C++
#include <stdio.h> int main(){ int a=0,b=0; while (scanf("%d%d", &a, &b)!=EOF){ if (a + b < 1000000){ printf("6\n"); }else if(a + b < 100000){ printf("5\n"); }else if (a + b < 10000){ printf("4\n"); }else if (a + b < 1000){ printf("3\n"); }else if (a + b < 100){ printf("2\n"); }else ...
a.cc: In function 'int main()': a.cc:20:38: error: 'x' was not declared in this scope 20 | printf("1\n",x); | ^
s520647933
p00002
C++
#include <stdio.h> int main(){ int a=0,b=0,x=0; while (scanf("%d%d", &a, &b)!=EOF){ if (a + b < 1000000){ x=6; }else if(a + b < 100000){ x=5; }else if (a + b < 10000){ x=4; }else if (a + b < 1000){ x=3; }else if (a + b < 100){ x=2; }else(a + b < 10){ x=1; }printf("%d\n", x); } ...
a.cc: In function 'int main()': a.cc:19:34: error: expected ';' before '{' token 19 | }else(a + b < 10){ | ^ | ;
s898607622
p00002
C++
import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); for (int i = 0; i < 200; i++) { int sum; int[] n = new int[2]; n[0] = sc.nextInt(); n[1] = sc.nextInt(); sum = n[0] + n[1]...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:11: error: expected ':' before 'static' 5 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:5:29: e...
s619123138
p00002
C++
#include<iostream> int main(){ int a, b, c = 0, d = 0; std::cin >> a >> b; for(){ if(a < 10){ a = a % 10; c++; }else break; } for(){ if(b < 10){ b = b % 10; d++; }else ...
a.cc: In function 'int main()': a.cc:6:5: error: expected primary-expression before ')' token 6 | for(){ | ^ a.cc:13:1: error: expected primary-expression before 'for' 13 | for(){ | ^~~ a.cc:12:10: error: expected ';' before 'for' 12 | } | ^ | ; 13 | fo...
s155204809
p00002
C++
#include<iostream> #include<sstream> #include<string> #include<list> using namespace std; int main(){ int a, b; list<int> digit; while((cin>>a>>b).eof()){ if((a+b)>0){ string stream c << a+b; digit.push_back(c.str().size()); } } list<int>::iterator it = digit.begin(); while(it != digit.end()){ c...
a.cc: In function 'int main()': a.cc:13:39: error: expected initializer before 'c' 13 | string stream c << a+b; | ^ a.cc:14:41: error: 'c' was not declared in this scope 14 | digit.push_back(c.str().size()); | ...
s897617486
p00003
Java
import java.util.Scanner; public class Main { public static void main(String a[]){ Scanner sc = new Scanner(); int N = sc.nextInt(); for(int i=0;i<N;i++){ int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); System.out.println(isRightTriangle(b,c,d)); } } public static St...
Main.java:5: error: no suitable constructor found for Scanner(no arguments) Scanner sc = new Scanner(); ^ constructor Scanner.Scanner(Readable,Pattern) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Readable) is not applicable (actu...
s669353605
p00003
Java
import java.util.Scanner; public class Main { public static void main(String a[]){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i=0;i<N;i++){ int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); System.out.println(isRightTriangle(b,c,d)); } } public ...
Main.java:30: error: class, interface, enum, or record expected return "No"; ^ Main.java:31: error: class, interface, enum, or record expected else ^ Main.java:33: error: class, interface, enum, or record expected } ^ 3 errors
s684753616
p00003
Java
import java.util.Scanner; public class A { public static void main(String a[]){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i=0;i<N;i++){ int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); System.out.println(isRightTriangle(b,c,d)); } sc.close(); } ...
Main.java:3: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s589027151
p00003
Java
package volume00.pck2003; /** * Created by nakataninaoki on 2014/08/07. */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; //import java.util.Arrays; import java.util.StringTokenizer; public class P0003_2 { public static void main(String[] args) throws IOException {...
Main.java:26: error: ';' expected num[0] = Integer.parseInt(st.nextToken())); ^ 1 error
s802836136
p00003
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class P0003_2 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = "...
Main.java:19: error: ';' expected num[0] = Integer.parseInt(st.nextToken())); ^ 1 error
s225959711
p00003
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; ...
Main.java:19: error: ';' expected num[0] = Integer.parseInt(st.nextToken())); ^ 1 error
s814074591
p00003
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; ...
Main.java:19: error: ';' expected num[0] = Integer.parseInt(st.nextToken())); ^ 1 error
s789441287
p00003
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.lang.Integer; import java.lang.String; import java.lang.System; import java.util.StringTokenizer; class Main { public static void main(String[] a) throws IOException { BufferedReader r = new BufferedReader(InputStreamReader(System...
Main.java:38: error: '(' expected } catch { ^ Main.java:38: error: illegal start of type } catch { ^ 2 errors
s297820016
p00003
Java
package aoj0003; import java.util.Arrays; import java.util.Scanner; public class aoj0003 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); for(int i=0;i<n;i++){ int [] es = new int[3]; for(int j=0;j<3;j++) es[j] =...
Main.java:6: error: class aoj0003 is public, should be declared in a file named aoj0003.java public class aoj0003 { ^ 1 error
s861651927
p00003
Java
import java.util.Arrays; import java.util.Scanner; public class aoj0003 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); for(int i=0;i<n;i++){ int [] es = new int[3]; for(int j=0;j<3;j++) es[j] = in.nextInt(); ...
Main.java:4: error: class aoj0003 is public, should be declared in a file named aoj0003.java public class aoj0003 { ^ 1 error
s278829330
p00003
Java
public class Main { public static void main(String[] args) { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); try { Integer dataNum = Integer.valueOf(in.readLine()); for (int i = 0; i < dataNum.intValue(); i++) { String[] problemDa...
Main.java:4: error: cannot find symbol BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:4: error: cannot find symbol BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ...
s610637381
p00003
Java
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Main { public static int main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); int arr...
Main.java:41: error: missing return statement } ^ 1 error
s685412743
p00003
Java
import java.io.*; public class Test { public static void main(String[] args) throws IOException { BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(buf.readLine()); String[] list; String[] check = new String[N]; int i,j,l; for(int k=0;...
Main.java:4: error: class Test is public, should be declared in a file named Test.java public class Test { ^ 1 error
s449018508
p00003
Java
import java.io.IOException import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); St...
Main.java:1: error: ';' expected import java.io.IOException ^ 1 error
s713731294
p00003
Java
package byakko; import java.util.Scanner; public class a{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int b,x,max,SH; x = s.nextInt(); int[][] a = new int[x][3]; for(b = 0; b < x; b++){ a[b][0] = s.nextInt(); a[b][1] = s.nextInt(); a[b][2] = s.nextInt(); ...
Main.java:5: error: class a is public, should be declared in a file named a.java public class a{ ^ 1 error
s615081087
p00003
Java
import java.util.Scanner; public class a{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int b,x,max,SH; while(s.hasNextInt()){ x = s.nextInt(); int[][] a = new int[x][3]; for(b = 0; b < x; b++){ a[b][0] = s.nextInt(); a[b][1] = s.nextInt(); a[b][2] = s.nex...
Main.java:3: error: class a is public, should be declared in a file named a.java public class a{ ^ 1 error