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 ';' before 'return' 7 | } | ^ | ; 8 | return result; | ~~~~~~ a.cc:8:9: error: expected primary-expression before 'return' 8 | return result; | ^~~~~~ a.cc:7:10: error: expected ')' before 'return' 7 | } | ^ | ) 8 | return result; | ~~~~~~ a.cc:4:12: note: to match this '(' 4 | for(atai != 0){ | ^ a.cc:9:1: warning: control reaches end of non-void function [-Wreturn-type] 9 | } | ^
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)); | ^~~~ | | | int In file included from a.cc:3: /usr/include/stdio.h:365:38: note: initializing argument 1 of 'int sprintf(char*, const char*, ...)' 365 | extern int sprintf (char *__restrict __s, | ~~~~~~~~~~~~~~~~~^~~
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){ t=t*10; i++; } return i; } }
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:33: error: 'String' has not been declared 4 | public static void main(String args[]){ | ^~~~~~ a.cc:26:2: error: expected ';' after class definition 26 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:5:17: error: 'Scanner' was not declared in this scope 5 | Scanner sc = new Scanner(System.in); | ^~~~~~~ a.cc:6:23: error: 'sc' was not declared in this scope 6 | while(sc.hasNext()){ | ^~ a.cc:10:25: error: 'System' was not declared in this scope 10 | System.out.println(sum(wa)); | ^~~~~~ a.cc:12:17: error: 'sc' was not declared in this scope 12 | sc.close(); | ^~
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 << endl; | ^~~~ a.cc:15:24: error: 'endl' was not declared in this scope 15 | cout << cnt << endl; | ^~~~
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 | printf_s("%d\n",(int)log10((double)a+b)+1); | ^~~~~~~~ | printf
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) c++; cout<<c<<endl; } }
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 <cstring> 3 | using namespace std;
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 file included from /usr/include/c++/14/cstdio:42, from a.cc:1: /usr/include/stdio.h:365:38: note: initializing argument 1 of 'int sprintf(char*, const char*, ...)' 365 | extern int sprintf (char *__restrict __s, | ~~~~~~~~~~~~~~~~~^~~
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)); | ^ | | | std::string* {aka std::__cxx11::basic_string<char>*} In file included from /usr/include/c++/14/cstdio:42, from a.cc:1: /usr/include/stdio.h:365:38: note: initializing argument 1 of 'int sprintf(char*, const char*, ...)' 365 | extern int sprintf (char *__restrict __s, | ~~~~~~~~~~~~~~~~~^~~
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",atoi(a) + atoi(b)); printf("%d\n",strlen(digits)); }else if(IsB == 0){ a[i++] = str; }else{ b[i++] = str; } } }
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(digits,"%d",atoi(a) + atoi(b)); printf("%d\n",strlen(digits)); i = 0; IsB = 0; }else if(IsB == 0){ a[i++] = str; }else{ b[i++] = str; } } }
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 << endl << m2 << endl << m3 <<endl; return 0; }
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 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | cin << m << endl; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:7:9: note: candidate: 'operator<<(int, int)' (built-in) 7 | cin << m << endl; | ~~~~^~~~ a.cc:7:9: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << m << endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:7:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 7 | cin << m << endl; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << m << endl; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:7:12: required from here 7 | cin << m << endl; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
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 <cstring> 3 | #include <string>
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; ///< Linked to standard input | ^~~
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.Split(' '); int a = int.Parse(inputArr[0]); int b = int.Parse(inputArr[1]); int sum = a + b; Console.WriteLine(sum.ToString().Length); } while (true); } }
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.Collections.Generic; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.IO; | ^~~~~~ a.cc:8:26: error: 'string' has not been declared 8 | static void Main(string[] args) | ^~~~~~ a.cc:8:35: error: expected ',' or '...' before 'args' 8 | static void Main(string[] args) | ^~~~ a.cc:24:2: error: expected ';' after class definition 24 | } | ^ | ; a.cc: In static member function 'static void ListOfTopThreeHills::Main(int*)': a.cc:12:25: error: 'string' was not declared in this scope 12 | string input = Console.ReadLine(); | ^~~~~~ a.cc:13:50: error: 'input' was not declared in this scope; did you mean 'int'? 13 | if (string.IsNullOrEmpty(input)) | ^~~~~ | int a.cc:17:25: error: expected primary-expression before ']' token 17 | string[] inputArr = input.Split(' '); | ^ a.cc:18:26: error: expected primary-expression before 'int' 18 | int a = int.Parse(inputArr[0]); | ^~~ a.cc:19:26: error: expected primary-expression before 'int' 19 | int b = int.Parse(inputArr[1]); | ^~~ a.cc:21:18: error: 'Console' was not declared in this scope 21 | Console.WriteLine(sum.ToString().Length); | ^~~~~~~ a.cc:21:40: error: request for member 'ToString' in 'sum', which is of non-class type 'int' 21 | Console.WriteLine(sum.ToString().Length); | ^~~~~~~~
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> +++ |+#include <cstring> 3 |
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 <cstring> 3 |
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 + data_size*4)" << *(a + data_size*0) * *(a + data_size*4) << endl; */ int z = *(a + 0) * *(a + 4) - *(a + 1) * *(a + 3); int x = *(a + 2) * *(a + 4) - *(a + 1) * *(a + 5); int y = *(a + 0) * *(a + 5) - *(a + 2) * *(a + 3); double ax,ay; /*cout << "x=" << x << endl; cout << "y=" << y << endl;*/ ax = pow(z,-1)*x; ay = pow(z,-1)*y; /* cout << ax << endl; cout << ay << endl; */ double ans[2] = {ax,ay}; return ans; } int main() { int n[6]; int s; int i=0; while (cin >> s){ if (i == 5){ n[i]=s; for (int j=0;j<=5;j++) { cout << "n[" << j << "]=" << n[j] << endl; } double* an; an = solve_equations(n); /* printf("%.3lf",*(an+0)); cout << " " << endl; printf("%.3lf",*(an+1)); */ cout << fixed << setprecision(3) << an[1] << " " << an[0] << endl; i = 0;} else{ n[i]=s; i++; } } return 0; // cout << l[0] endl; }
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: note: declared here 28 | double ans[2] = {ax,ay}; | ^~~
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 | int digit( x ){ | ^~~~~ a.cc:3:5: note: 'int digit' previously defined here 3 | int digit( x ); | ^~~~~ a.cc:16:12: error: 'x' was not declared in this scope 16 | int digit( x ){ | ^
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<<std::endl else std::cout<<1<<std::endl; return 0; }
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 >= s[1].length()-1 ? s[0].length()-1 : s[1].length()-1; j = s[0].length()-1 <= s[1].length()-1 ? s[0].length()-1 : s[1].length()-1; l = s[0].length()-1 >= s[1].length()-1 ? 0 : 1; int a[][] = {new int[i+1], new int[j+1]}; for(int k = 0;k < i+1;k++) { a[0][k] = s[l].charAt(k)-'0'; } int f = Math.abs(l-1); for(int k = 0;k < j+1;k++) { a[1][k] = s[f].charAt(k)-'0'; } while(i>=0) { if(j >= 0) m = a[1][j]; else m = 0; a[0][i] = a[0][i] + m; if(a[0][i]>9) { if(i>0) { a[0][i] %= 10; a[0][i-1]++; } else if(i==0){ flag = true; break; } } i--; j--; } ans = flag ? a[0].length+1 : a[0].length; System.out.println(ans); flag = false; } } catch(IOException e) { System.out.println(e); } } }
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:33: error: 'String' has not been declared 4 | public static void main(String args[]) { | ^~~~~~ a.cc:51:2: error: expected ';' after class definition 51 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:6:25: error: 'BufferedReader' was not declared in this scope 6 | BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); | ^~~~~~~~~~~~~~ a.cc:7:25: error: 'String' was not declared in this scope 7 | String s[], t; | ^~~~~~ a.cc:9:25: error: 'boolean' was not declared in this scope; did you mean 'bool'? 9 | boolean flag = false; | ^~~~~~~ | bool a.cc:10:32: error: 't' was not declared in this scope 10 | while((t = reader.readLine()) != null) { | ^ a.cc:10:36: error: 'reader' was not declared in this scope 10 | while((t = reader.readLine()) != null) { | ^~~~~~ a.cc:10:58: error: 'null' was not declared in this scope 10 | while((t = reader.readLine()) != null) { | ^~~~ a.cc:11:33: error: 's' was not declared in this scope 11 | s = t.split(" "); | ^ a.cc:15:37: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first 15 | int a[][] = {new int[i+1], new int[j+1]}; | ^ a.cc:17:41: error: 'a' was not declared in this scope 17 | a[0][k] = s[l].charAt(k)-'0'; | ^ a.cc:19:41: error: 'Math' was not declared in this scope 19 | int f = Math.abs(l-1); | ^~~~ a.cc:21:41: error: 'a' was not declared in this scope 21 | a[1][k] = s[f].charAt(k)-'0'; | ^ a.cc:25:53: error: 'a' was not declared in this scope 25 | m = a[1][j]; | ^ a.cc:28:41: error: 'a' was not declared in this scope 28 | a[0][i] = a[0][i] + m; | ^ a.cc:35:57: error: 'flag' was not declared in this scope 35 | flag = true; | ^~~~ a.cc:42:39: error: 'flag' was not declared in this scope 42 | ans = flag ? a[0].length+1 : a[0].length; | ^~~~ a.cc:42:46: error: 'a' was not declared in this scope 42 | ans = flag ? a[0].length+1 : a[0].length; | ^ a.cc:43:33: error: 'System' was not declared in this scope 43 | System.out.println(ans); | ^~~~~~ a.cc:47:23: error: 'IOException' does not name a type 47 | catch(IOException e) { | ^~~~~~~~~~~ a.cc:48:25: error: 'System' was not declared in this scope 48 | System.out.println(e); | ^~~~~~ a.cc:48:44: error: 'e' was not declared in this scope 48 | System.out.println(e); | ^
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 standard input | ^~~ a.cc:7:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout << i+j << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout << i+j << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
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 < datanum ; i ++ ) { for( int j = 1 ; j < 7 ; j ++ ) { if( (sum[i] / 10*j) < 10 ) { solve[i] = j+1 ; j = 10 ; cout << solve[i] << "\n" ; } } } _getch() ; return 0 ; }
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/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
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); | ~ ^ | ) 10 | } | ~ a.cc:10:1: error: expected primary-expression before '}' token 10 | } | ^
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>} a.cc:7:13: note: candidate: 'operator<<(int, int)' (built-in) 7 | while(cin << a << b){ | ~~~~^~~~ a.cc:7:13: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:7:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 7 | while(cin << a << b){ | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:7:16: required from here 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
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>} a.cc:7:13: note: candidate: 'operator<<(int, int)' (built-in) 7 | while(cin << a << b){ | ~~~~^~~~ a.cc:7:13: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:7:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 7 | while(cin << a << b){ | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:7:16: required from here 7 | while(cin << a << b){ | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
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 if (a + b < 10){ printf("1\n",x); } } return 0; }
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 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
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 if (a + b < 10){ printf("1\n",x); } } return 0; }
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); } return 0; }
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]; String s; s = String.valueOf(sum); System.out.println(s.length()); } } }
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: error: 'String' has not been declared 5 | public static void main(String[] args) { | ^~~~~~ a.cc:5:38: error: expected ',' or '...' before 'args' 5 | public static void main(String[] args) { | ^~~~ a.cc:19:2: error: expected ';' after class definition 19 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:6:9: error: 'Scanner' was not declared in this scope 6 | Scanner sc = new Scanner(System.in); | ^~~~~~~ a.cc:9:16: error: structured binding declaration cannot have type 'int' 9 | int[] n = new int[2]; | ^~ a.cc:9:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:9:16: error: empty structured binding declaration a.cc:9:19: error: expected initializer before 'n' 9 | int[] n = new int[2]; | ^ a.cc:10:13: error: 'n' was not declared in this scope 10 | n[0] = sc.nextInt(); | ^ a.cc:10:20: error: 'sc' was not declared in this scope 10 | n[0] = sc.nextInt(); | ^~ a.cc:13:13: error: 'String' was not declared in this scope 13 | String s; | ^~~~~~ a.cc:14:13: error: 's' was not declared in this scope 14 | s = String.valueOf(sum); | ^ a.cc:15:13: error: 'System' was not declared in this scope 15 | System.out.println(s.length()); | ^~~~~~
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 break; } std::cout << c + d; }
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 | for(){ | ~~~ a.cc:13:1: error: expected primary-expression before 'for' 13 | for(){ | ^~~ a.cc:12:10: error: expected ')' before 'for' 12 | } | ^ | ) 13 | for(){ | ~~~ a.cc:6:4: note: to match this '(' 6 | for(){ | ^ a.cc:13:5: error: expected primary-expression before ')' token 13 | for(){ | ^ a.cc:21:1: error: expected primary-expression before '}' token 21 | } | ^ a.cc:20:20: error: expected ')' before '}' token 20 | std::cout << c + d; | ^ | ) 21 | } | ~ a.cc:13:4: note: to match this '(' 13 | for(){ | ^ a.cc:21:1: error: expected primary-expression before '}' token 21 | } | ^
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()){ cout << *it << endl; it++; } return 0; }
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 String isRightTriangle(int a, int b ,int c){ if(a + b < c) return "No"; else if(b + c < a) return "No"; else if(c + a < b) return "No"; else return "Yes"; } }
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 (actual and formal argument lists differ in length) constructor Scanner.Scanner(InputStream) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(InputStream,String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(InputStream,Charset) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(File) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(File,String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(File,Charset) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(File,CharsetDecoder) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Path) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Path,String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Path,Charset) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(ReadableByteChannel) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable (actual and formal argument lists differ in length) 1 error
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 static String isRightTriangle(int a, int b ,int c){ if(a + b < c) return "No"; else if(b + c < a) return "No"; else if(c + a < b) return "No"; else return "Yes"; } } return "No"; else return "Yes"; } }
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(); } public static String isRightTriangle(int a, int b ,int c){ if(a>b){ int k = a; a = b; b = k; } if(b>c){ int k = b; b = c; c= k; } if(c*c == a*a+b*b) return "YES"; else return "NO"; } }
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 { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; while ((line = br.readLine()) != null && !line.isEmpty()) { int N = Integer.parseInt(line); next: for (int i = 0; i < N; i++) { int[] num = new int[3]; StringTokenizer st = new StringTokenizer(br.readLine()); num[0] = Integer.parseInt(st.nextToken())); num[1] = Integer.parseInt(st.nextToken()); num[2] = Integer.parseInt(st.nextToken()); num[0] *= num[0]; num[1] *= num[1]; num[2] *= num[2]; for (int j = 0; j < 3; j++) { if (num[j % 3] == num[(j + 1) % 3] + num[(j + 2) % 3]) { System.out.println("YES"); continue next; } } System.out.println("NO"); } } } }
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 = ""; while ((line = br.readLine()) != null && !line.isEmpty()) { int N = Integer.parseInt(line); next: for (int i = 0; i < N; i++) { int[] num = new int[3]; StringTokenizer st = new StringTokenizer(br.readLine()); num[0] = Integer.parseInt(st.nextToken())); num[1] = Integer.parseInt(st.nextToken()); num[2] = Integer.parseInt(st.nextToken()); num[0] *= num[0]; num[1] *= num[1]; num[2] *= num[2]; for (int j = 0; j < 3; j++) { if (num[j % 3] == num[(j + 1) % 3] + num[(j + 2) % 3]) { System.out.println("YES"); continue next; } } System.out.println("NO"); } } } }
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 = ""; while ((line = br.readLine()) != null && !line.isEmpty()) { int N = Integer.parseInt(line); next: for (int i = 0; i < N; i++) { int[] num = new int[3]; StringTokenizer st = new StringTokenizer(br.readLine()); num[0] = Integer.parseInt(st.nextToken())); num[1] = Integer.parseInt(st.nextToken()); num[2] = Integer.parseInt(st.nextToken()); num[0] *= num[0]; num[1] *= num[1]; num[2] *= num[2]; for (int j = 0; j < 3; j++) { if (num[j % 3] == num[(j + 1) % 3] + num[(j + 2) % 3]) { System.out.println("YES"); continue next; } } System.out.println("NO"); } } } }
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 = ""; while ((line = br.readLine()) != null && !line.isEmpty()) { int N = Integer.parseInt(line); next: for (int i = 0; i < N; i++) { int[] num = new int[3]; StringTokenizer st = new StringTokenizer(br.readLine()); num[0] = Integer.parseInt(st.nextToken())); num[1] = Integer.parseInt(st.nextToken()); num[2] = Integer.parseInt(st.nextToken()); num[0] *= num[0]; num[1] *= num[1]; num[2] *= num[2]; for (int j = 0; j < 3; j++) { if (num[j % 3] == num[(j + 1) % 3] + num[(j + 2) % 3]) { System.out.println("YES"); continue next; } } System.out.println("NO"); } } } }
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.in)); try { int count = Integer.parseInt(r.readLine()); String[] ans = new String[count]; for(int i = 0; i < count; i++) { String s = r.readLine(); StringTokenizer st = new StringTokenizer(s); int num[] = new int[4]; for(int j = 0; j < 3;j++) { num[j] = Integer.parseInt(st.nextToken()); if(num[0] < num[j]) { int tmp = num[0]; num[0] = num[j]; num[j] = tmp; } } if ( num[0] * num[0] == num[1] * num[1] + num[2] * num[2]) { ans[i] = "YES"; } else { ans[i] = "NO"; } } for(int i = 0; i < count; i++) { System.out.println(ans[i]); } } catch { System.exit(0); } } }
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] = in.nextInt(); Arrays.sort(es); if(sq(es[0]) + sq(es[1]) == sq(es[2])){ System.out.println("YES"); }else{ System.out.println("NO"); } } } static int sq(int x){ return x*x; }; }
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(); Arrays.sort(es); if(sq(es[0]) + sq(es[1]) == sq(es[2])){ System.out.println("YES"); }else{ System.out.println("NO"); } } } static int sq(int x){ return x*x; }; }
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[] problemData = in.readLine().split("\\s"); int max = 0; int other1 = 0; int other2 = 0; for (String data : problemData) { int dataInt = Integer.valueOf(data); other2 = other1; if (dataInt > max) { other1 = max; max = dataInt; } else { other1 = dataInt; } } if ((max * max) == (other1 * other1 + other2 * other2)) { System.out.println("YES"); } else { System.out.println("NO"); } } } catch (IOException e) { e.printStackTrace(); } finally { try { in.close(); } catch (IOException e) { e.printStackTrace(); } } } }
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)); ^ symbol: class BufferedReader location: class Main Main.java:4: error: cannot find symbol BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main Main.java:39: error: cannot find symbol } catch (IOException e) { ^ symbol: class IOException location: class Main Main.java:44: error: cannot find symbol } catch (IOException e) { ^ symbol: class IOException location: class Main 5 errors
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[]; double ans[]; while( sc.hasNext() ){ arr = new int[3]; ans = new double[3]; String line[] = sc.nextLine().split(" "); arr[0] = Integer.parseInt(line[0]); arr[1] = Integer.parseInt(line[1]); arr[2] = Integer.parseInt(line[2]); //int arr[] = {3,4,5}; Arrays.sort(arr); int i; for (i = 0;i < 3; i++){ ans[i] = arr[i] * arr[i]; } if (ans[0] + ans[1] == ans[2]){ System.out.println("YES"); }else{ System.out.println("NO"); } } } }
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; k<N; k++){ list = buf.readLine().split(" "); i = Integer.parseInt(list[0]); j = Integer.parseInt(list[1]); l = Integer.parseInt(list[2]); check[k] = Check(i,j,l); } for(int k = 0; k<N-1; k++){ System.out.println(check[k]); } int n = N-1; System.out.print(check[n]); } public static String Check(int a,int b,int c){ if(a-b >0 && a-c>0){ if(a*a == b*b + c*c){ return"Yes"; }else{ return "No"; } }else if(b-a >0 && b-c>0){ if(b*b == a*a + c*c){ return "Yes"; }else{ return "No"; } }else{ if(c*c == b*b + a*a){ return "Yes"; }else{ return "No"; } } } }
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)); String line = br.readLine(); int N = Integer.parseInt(line); for (int i=0; i<N; i++){ String l = br.readLine(); Scanner sc = new Scanner(l); int a[]; a = new int[3]; for (int j=0; j<3; j++){ a[j] = sc.nextInt(); } Arrays.sort(a); if ((a[0]*a[0] + a[1]*a[1]) == a[2]*a[2]){ System.out.println("YES"); }else{ System.out.println("NO"); } } } }
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(); } for(b = 0; b < x; b++){ max = a[b][0]; if(a[b][1] > max) max = a[b][0]; if(a[b][2] > max) max = a[b][2]; SH = a[b][0]*a[b][0] + a[b][1]*a[b][1]; max = max*max; if(SH == max){ System.out.println("YES"); }else{ System.out.println("NO"); } } } }
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.nextInt(); } for(b = 0; b < x; b++){ max = a[b][0]; if(a[b][1] > max) max = a[b][0]; if(a[b][2] > max) max = a[b][2]; SH = a[b][0]*a[b][0] + a[b][1]*a[b][1]; max = max*max; if(SH == max){ System.out.println("YES"); }else{ System.out.println("NO"); } } } } }
Main.java:3: error: class a is public, should be declared in a file named a.java public class a{ ^ 1 error