submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s004078951
p00051
C
#include <stdio.h> int ten(int); int main(void) { char a[8],tmp; int s,i,j,n,c,max,min; scanf("%d",&n); for(c=0;c<n;c++){ scanf("%s",&a); for(i=0;i<8;i++){ for(j=i;j<8;j++){ if(a[i]<a[j]){ tmp=a[i]; a[i]=a[j]; a[j]=tmp; } } } max=min=0; for(i=0;i<8;i++){2 max+=(a[i]-48)*te...
main.c: In function 'main': main.c:21:35: error: expected ';' before 'max' 21 | for(i=0;i<8;i++){2 | ^ | ; 22 | max+=(a[i]-48)*ten(7-i); | ~~~
s724994728
p00051
C
#include <algorithm> #include <cstdio> #define N 8 using namespace std; /** Application main entry point. */ int main ( int argc, char * argv[ ] ) { int n; int i; for ( scanf ( "%d", &n ); n--; ) { char digs[ N ]; int max = 0, min = 0; scanf ( " %c%c%c%c%c%c%c%c", digs,...
main.c:1:10: fatal error: algorithm: No such file or directory 1 | #include <algorithm> | ^~~~~~~~~~~ compilation terminated.
s093808474
p00051
C
/* AizuOnline A0051 Differential II */ #include <stdio.h> #include <stdlib.h> compare_char(char *a,char *b) {return(*a-*b); } compare_char_r(char *a,char *b) {return(*b-*a); } main() { char n8[]; int n; long int maxval,minval; scanf("%d",&n); while(n--) { scanf("%s",n8); qsort(n8,8,1,com...
main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int] 8 | compare_char(char *a,char *b) | ^~~~~~~~~~~~ main.c:11:1: error: return type defaults to 'int' [-Wimplicit-int] 11 | compare_char_r(char *a,char *b) | ^~~~~~~~~~~~~~ main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int...
s839033141
p00051
C++
n = input() for _ in xrange(n): x = list(raw_input()) x.sort() mi = int("".join(x)) ma = int("".join(reversed(x))) print ma - mi
a.cc:1:1: error: 'n' does not name a type 1 | n = input() | ^
s044115038
p00051
C++
#include<cstdio> #include<algorithm> #include<vector> #include<string> #include<iostream> #include<queue> #include<map> #include<set> #include<complex> #include<stack> #include<cmath> using namespace std; #define reps(i,f,n) for(int i=f;i<int(n);i++) #define rep(i,n) reps(i,0,n) int stoi(string a){ int ret = 0; i...
a.cc: In function 'int main()': a.cc:46:35: error: call of overloaded 'stoi(std::string&)' is ambiguous 46 | printf("%d\n",stoi(c)-stoi(b)); | ~~~~^~~ a.cc:19:5: note: candidate: 'int stoi(std::string)' 19 | int stoi(string a){ | ^~~~ In file included ...
s249857345
p00051
C++
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <algorithm> #include <vector> #include <cstdlib> #include <functional> using namespace std; int solve(int in){ char mozi[9] = {}; int max, min; _itoa(in, mozi, 10); sort(mozi, mozi + 8); min = atoi(mozi); sort(mozi, mozi + 8, greater<int>()); max = ...
a.cc: In function 'int solve(int)': a.cc:12:9: error: '_itoa' was not declared in this scope 12 | _itoa(in, mozi, 10); | ^~~~~
s081686184
p00051
C++
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <algorithm> #include <vector> #include <cstdlib> #include <functional> using namespace std; int solve(int in){ char mozi[9] = {}; int max, min; itoa(in, mozi, 10); sort(mozi, mozi + 8); min = atoi(mozi); sort(mozi, mozi + 8, greater<int>()); max = a...
a.cc: In function 'int solve(int)': a.cc:12:9: error: 'itoa' was not declared in this scope 12 | itoa(in, mozi, 10); | ^~~~
s757362693
p00051
C++
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <algorithm> #include <vector> #include <cstdlib> #include <functional> using namespace std; int solve(int in){ char mozi[9] = {}; int max, min; itoa(in, mozi, 10); sort(mozi, mozi + 8); min = atoi(mozi); sort(mozi, mozi + 8, greater<int>()); max = a...
a.cc: In function 'int solve(int)': a.cc:12:9: error: 'itoa' was not declared in this scope 12 | itoa(in, mozi, 10); | ^~~~
s091124004
p00051
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n , max , min , sa; string s , t; cin >> n; while(n--){ cin >> s: t=s; sort(s.begin() , s.end()); reverse(t.begin() , t.end()); sa=atoi(s.c_str())-atoi(t.c_str); ...
a.cc: In function 'int main()': a.cc:12:17: error: found ':' in nested-name-specifier, expected '::' 12 | cin >> s: | ^ | :: a.cc:12:16: error: 's' is not a class, namespace, or enumeration 12 | cin >> s: | ^ a.cc:16:35: error: inval...
s617307726
p00051
C++
#include <iostream> #include <string> #include <algorithm> #include<cstdlib> using namespace std; int main() { int n , sa; string s , t; cin >> n; while(n--){ cin >> s: t=s; sort(s.begin() , s.end()); reverse(t.begin() , t.end()); sa=atoi(s.c_str())-atoi(t.c_str)...
a.cc: In function 'int main()': a.cc:13:17: error: found ':' in nested-name-specifier, expected '::' 13 | cin >> s: | ^ | :: a.cc:13:16: error: 's' is not a class, namespace, or enumeration 13 | cin >> s: | ^ a.cc:17:35: error: inval...
s462808577
p00051
C++
#include <iostream> #include <string> #include <algorithm> #include<cstdlib> using namespace std; int main() { int n , max , min , sa; string s; cin >> n; while(n--){ cin >> s: sort(s.begin() , s.end()); min=atoi(s.c_str()); reverse(s.begin() , s.end()); max=atoi...
a.cc: In function 'int main()': a.cc:13:17: error: found ':' in nested-name-specifier, expected '::' 13 | cin >> s: | ^ | :: a.cc:13:16: error: 's' is not a class, namespace, or enumeration 13 | cin >> s: | ^
s863950948
p00051
C++
for(j=1;c=require("fs").readFileSync("/dev/stdin","utf8").split(/\s/)[j++];)a=c.split(''),console.log(a.sort(function(x,y){return y-x}).join('')-a.sort().join(''));
a.cc:1:66: error: stray '\' in program 1 | for(j=1;c=require("fs").readFileSync("/dev/stdin","utf8").split(/\s/)[j++];)a=c.split(''),console.log(a.sort(function(x,y){return y-x}).join('')-a.sort().join('')); | ^ a.cc:1:87: error: empty character...
s578178790
p00051
C++
#include <iostream> using namespace std; int main(void){ // Here your code ! string a; int n,x; cin>>n; while(n--){ cin>>a; sort(a.begin(),a.end()); x=atoi(a.c_str()); reverse(a.begin(),a.end()); cout<<atoi(a.c_str())-x<<endl; } }
a.cc: In function 'int main()': a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(a.begin(),a.end()); | ^~~~ | short a.cc:12:9: error: 'reverse' was not declared in this scope 12 | reverse(a.begin(),a.end()); | ^~~~~~...
s124057420
p00051
C++
#include <iostream> #include <sstream> #include <cstdlib> using namespace std; int main(void){ // Here your code ! string a; int n,x; cin>>n; while(n--){ cin>>a; sort(a.begin(),a.end()); x=atoi(a.c_str()); reverse(a.begin(),a.end()); cout<<atoi(a.c_str())-x<<e...
a.cc: In function 'int main()': a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a.begin(),a.end()); | ^~~~ | short a.cc:14:9: error: 'reverse' was not declared in this scope 14 | reverse(a.begin(),a.end()); | ^~~~~~...
s128600181
p00051
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { int n, o = 0, ma, mi; string s; cin >> n; for (; n-- > 0;) { cin >> s; vector<int> v; for (int i = 0; i < s.size(); i++) { v.push_back(s[i] - '0'); } sort(v.begin(), v.end()); o = s.size...
a.cc: In function 'int main()': a.cc:25:46: error: 'pow' was not declared in this scope 25 | ma += v[o - i - 1] * pow(10, i); | ^~~
s089868421
p00051
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { int n, o = 0, ma, mi; string s; cin >> n; for (; n-- > 0;) { cin >> s; vector<int> v; for (int i = 0; i < s.size(); i++) { v.push_back(s[i] - '0'); } sort(v.begin(), v.end()); o = s.size...
a.cc: In function 'int main()': a.cc:25:46: error: 'pow' was not declared in this scope 25 | ma += v[o - i - 1] * pow(10, i); | ^~~
s373924174
p00051
C++
#include<iostream> #include<cstdio> #include<string> using namespace std; int main(){ int n; char buff[10]; scanf("%d",&n); for(int cas=0;cas<n;cas++){ cin >> buff; sort(buff,buff+8); //cout << buff << endl; int maxs,mins; maxs = mins = 0; for(int i=0;i<8;i++){ maxs*= 10; min...
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(buff,buff+8); | ^~~~ | short
s377178726
p00051
C++
#include<iostream> #include<cstdio> #include<string> using namespace std; int main(){ int n; char buff[10]; scanf("%d",&n); for(int cas=0;cas<n;cas++){ cin >> buff; sort(buff,buff+8); //cout << buff << endl; int maxs,mins; maxs = mins = 0; for(int i=0;i<8;i++){ maxs*= 10; min...
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(buff,buff+8); | ^~~~ | short
s764722332
p00051
C++
#include<stdio.h> int main(void) { int n, i, l, scanf("%d", &n); while ( n ) { scanf("%d", a); A[8] = a / 10000000; b[8] = a[8]; A[7] = ( a % 10000000 ) / 1000000; if ( b) A[6] = ( a % 1000000 ) / 100000; A[5] = ( a % 100000 ) / 10000; A[4] = ( a % 10000 ) / 1000; ...
a.cc: In function 'int main()': a.cc:4:18: error: expression list treated as compound expression in initializer [-fpermissive] 4 | scanf("%d", &n); | ^ a.cc:4:18: error: invalid conversion from 'int*' to 'int' [-fpermissive] 4 | scanf("%d", &n); | ^ | ...
s116181074
p00051
C++
(gets.to_i).times do n = gets.chomp.split("") min = n.sort.join max = n.sort.reverse.join puts max.to_i - min.to_i end
a.cc:1:6: error: expected ')' before '.' token 1 | (gets.to_i).times do | ~ ^ | )
s806443002
p00051
C++
#include<iostream> #include<array> int main() { int n; std::cin >> n; std::array<int, 8>num_array; for (int i = 0; i < n; i++) { int num; std::cin >> num; for (int i = 0; i < 8; i++) { num_array[i] = num_array[i] = num % 10; num /= 10; } } std::sort(num_array.begin(), num_array.end()); const int...
a.cc: In function 'int main()': a.cc:18:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 18 | std::sort(num_array.begin(), num_array.end()); | ^~~~ | qsort
s543085170
p00051
C++
#include <iostream> #include <cstdio> using namespace std; int main() { int N; scanf("%d ", &N); for (int i = 0 ;i < N; i++) { char num[8]; for (int j = 0; j < 8; j++) { scanf("%c", &num[j]); num[j] = num[j] - '0'; } vector<int> v(8); for (int j = 0; j < 8; j++) { v[i] = i;...
a.cc: In function 'int main()': a.cc:16:5: error: 'vector' was not declared in this scope 16 | vector<int> v(8); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <cstdio> +++ |+#include <vector> 3 | a....
s367301043
p00051
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> using namespace std; int main() { int N; scanf("%d ", &N); for (int i = 0 ;i < N; i++) { char num[8]; for (int j = 0; j < 8; j++) { scanf("%c ", &num[j]); num[j] = num[j] - '0'; } for (int j = 0; j < 8; j++) ...
a.cc: In function 'int main()': a.cc:38:2: error: expected '}' at end of input 38 | } | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s491720826
p00051
C++
include <iostream> #include <cstdio> #include <cmath> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { char ch[9]; scanf("%s", ch); int digit[8]; for (int j = 0; j < 8; j++) { digit[j] = ch[j] - '0'; } for (int j = ...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/cmath:45, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 1...
s828948837
p00051
C++
#include <iostream> #include <sstream> #include <string> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include <algorithm> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> #include <cmath> #include <memory.h> #include <cassert> using name...
a.cc: In function 'int main()': a.cc:54:29: error: expected primary-expression before '?' token 54 | ma >?= a; | ^ a.cc:54:30: error: expected primary-expression before '=' token 54 | ma >?= a; | ^...
s196238515
p00051
C++
#include <iostream> #include <algorithm> #include <functional> #include <cstdio> using namespace std; int main() { int n, i; char c[9], mx[9] = "", mn[9] = ""; while (cin >> n) { if (cin.eof()) return 0; for (i = 0; i < n; i++) { scanf("%s", &c); strcpy(mx, c); sort(mx, mx+8, greater<int>()); strc...
a.cc: In function 'int main()': a.cc:16:25: error: 'strcpy' was not declared in this scope 16 | strcpy(mx, c); | ^~~~~~ a.cc:5:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <cstdio> ...
s325243627
p00051
C++
#include <algorithm> using namespace std; int tonum(char *s) { int ret = 0; for (int i = 0; i < 8; i++) ret = ret*10 + s[i] - '0'; return ret; } int main() { int n; cin >> n; char s[9]; for (int i = 0; i < n; i++) { cin >> s; sort(s, s+8); int a = tonum(s); sort(s, s+8, greater<char>()); int b = ton...
a.cc: In function 'int main()': a.cc:12:16: error: 'cin' was not declared in this scope 12 | int n; cin >> n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <algorithm> +++ |+#include <iostre...
s424232669
p00051
C++
#include <algorithm> #include <deque> #include <functional> #include <iostream> using namespace std; int main() { int n, max, min; char s[8]; deque<int> x; cin >> n; while(1) { if(!n) break; x.clear(); max=min=0; cin >> s; for(int i=0; i<8; i++) { x.push_back((s[i]-48)); } sort(x.begin(),...
a.cc: In function 'int main()': a.cc:28:35: error: 'pow' was not declared in this scope 28 | max+=x[i]*pow(10, (double)(7-i)); | ^~~ a.cc:32:35: error: 'pow' was not declared in this scope 32 | min+=x[i]*pow(10, (double)(7-i))...
s627496202
p00051
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int main(){ int n,diff; char cdiff[8]; string keta,max_kazu,min_kazu; cin>>n; for(int i=0;i<n;i++){ cin>>keta; min_kazu=keta; max_kazu=keta; //昇順ソート stable_sort(min_kazu.begin(),min_kazu.end()); //降順ソート stab...
a.cc: In function 'int main()': a.cc:44:17: error: 'memset' was not declared in this scope 44 | memset(cdiff,'\0',sizeof(cdiff)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorith...
s181080203
p00051
C++
#include<iostream> #include<string> #include<cstdio> #include<algorithm> #include <functional> using namespace std; int main(void){ char buf[255]; int num; int n; cin >> n; gets(buf); for(int i=0; i<n; i++){ char str1[8],str2[8]; gets(str1); strcpy(str2,str1); cout << str1 << " " << str2 << endl; sor...
a.cc: In function 'int main()': a.cc:14:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 14 | gets(buf); | ^~~~ | getw a.cc:19:17: error: 'strcpy' was not declared in this scope 19 | strcpy(str2,str1); | ^~~~~~ a.cc:6:1...
s915977655
p00051
C++
#include <iostream> #include <sstream> #include <algorithm> #include <string> #include <cmath> #include <functional> using namespace std; int main() { string row; int minNum=INT32_MAX, maxNum=0, buf, n; cin>>n; for(int i=0; i<n; i++){ cin>>row; sort(row.begin(), row.end()); istringstream istr1(row); istr1...
a.cc: In function 'int main()': a.cc:12:20: error: 'INT32_MAX' was not declared in this scope 12 | int minNum=INT32_MAX, maxNum=0, buf, n; | ^~~~~~~~~ a.cc:7:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 6 | #includ...
s494375448
p00051
C++
#include <iostream> #include <sstream> #include <algorithm> #include <string> #include <cmath> #include <functional> #include <limits> using namespace std; int main() { string row; int minNum=INT32_MAX, maxNum=0, buf, n; cin>>n; for(int i=0; i<n; i++){ cin>>row; sort(row.begin(), row.end()); istringstream i...
a.cc: In function 'int main()': a.cc:13:20: error: 'INT32_MAX' was not declared in this scope 13 | int minNum=INT32_MAX, maxNum=0, buf, n; | ^~~~~~~~~ a.cc:7:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 6 | #includ...
s673072356
p00051
C++
#include <iostream> #include <sstream> #include <algorithm> #include <string> #include <cmath> #include <functional> #include <limits> #define INT32_MAX (2147483647) using namespace std; int main() { string row; cin>>n; for(int i=0; i<n; i++){ int minNum=INT32_MAX, maxNum=0, buf, n; cin>>row; sort(row.begin...
a.cc: In function 'int main()': a.cc:15:14: error: 'n' was not declared in this scope; did you mean 'yn'? 15 | cin>>n; | ^ | yn
s500810261
p00051
C++
#include <iostream> #include <sstream> #include <algorithm> #include <string> #include <cmath> #include <functional> #include <limits> #define INT32_MAX (2147483647) using namespace std; int main() { string row; cin>>n; for(int i=0; i<n; i++){ int minNum=INT32_MAX, maxNum=0, buf; cin>>row; sort(row.begin(),...
a.cc: In function 'int main()': a.cc:15:14: error: 'n' was not declared in this scope; did you mean 'yn'? 15 | cin>>n; | ^ | yn
s979379396
p00051
C++
#include<iostream> #include<string> using namespace std; long long int solve(string s) { for(int i=0;i<s.length();i++) { int min=i; for(int j=i;j<s.length();j++) { if(s[min]-'0'>s[j]-'0') { min=j; } } char tmp=s[i]; s[i]=s[min]; s[min]=tmp; } long long int min,max; min=max=0; for(int ...
a.cc: In function 'long long int solve(std::string)': a.cc:26:37: error: 'pow' was not declared in this scope 26 | max+=(long long int)pow(10.0,i)*(s[i]-'0'); | ^~~
s123527505
p00051
C++
#include<iostream> #include<string> using namespace std; long long int solve(string s) { for(int i=0;i<s.length();i++) { int min=i; for(int j=i;j<s.length();j++) { if(s[min]-'0'>s[j]-'0') { min=j; } } char tmp=s[i]; s[i]=s[min]; s[min]=tmp; } long long int min,max; min=max=0; for(int ...
a.cc: In function 'long long int solve(std::string)': a.cc:26:37: error: 'pow' was not declared in this scope 26 | max+=(long long int)pow(10.0,i)*(s[i]-'0'); | ^~~
s623635662
p00051
C++
#include <iostream> #include <functional> #include <algorithm> #include <cmath> #include <stdlib.h> using namespace std; int n,num1[8],m,M; int henkan() { int num = 0; for(int i = 0;i < 8 ;i++){ num+=num1[i]*pow(10,7-i); } return num; } int main(){ char num; cin >> n; for(int i = 0; i < n ; i++ ){
a.cc: In function 'int main()': a.cc:23:32: error: expected '}' at end of input 23 | for(int i = 0; i < n ; i++ ){ | ~^ a.cc:23:32: error: expected '}' at end of input a.cc:19:11: note: to match this '{' 19 | int main(){ | ^
s044735768
p00051
C++
#include<iostream> using namespace std; int StrtoInt(char *s){ int num = 0; while(*s!='\0'){ if( *s >= '0' && *s <= '9' ){ num = num*10 + *s - '0'; ++s; } } return num; } void UpBabbleSort(char *r, const char *s){ strcpy(r,s); for(int j=0;j<8;++j){ for(int i=0;i<8-j;++i){ if( r[i] <= r[i+1] ){ ...
a.cc: In function 'void UpBabbleSort(char*, const char*)': a.cc:15:9: error: 'strcpy' was not declared in this scope 15 | strcpy(r,s); | ^~~~~~ a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#...
s994249337
p00051
C++
#include<iostream> #include<string> using namespace std; int StrtoInt(char *s){ int num = 0; while(*s!='\0'){ if( *s >= '0' && *s <= '9' ){ num = num*10 + *s - '0'; ++s; } } return num; } void UpBabbleSort(char *r, const char *s){ strcpy(r,s); for(int j=0;j<8;++j){ for(int i=0;i<8-j;++i){ if( r[i...
a.cc: In function 'void UpBabbleSort(char*, const char*)': a.cc:16:9: error: 'strcpy' was not declared in this scope 16 | strcpy(r,s); | ^~~~~~ a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#...
s015593414
p00052
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * Factorial II */ public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; while ((line = br.re...
Main.java:45: error: reached end of file while parsing } ^ 1 error
s261154440
p00052
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(true){ int n = sc.nextInt(); if(n==0)break; int c = 0; while(n>=5){ c += n/5; n= n/5 } System.out.println(c); } } }
Main.java:13: error: ';' expected n= n/5 ^ 1 error
s836151324
p00052
Java
import java.io*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; int count; while(!(line=br.readLine()).equals("0")){ int n=Integer.parseInt(line); count=0; for(int i=1;i<=6;i++){ int d=Math.pow(5,i); if(n<d)...
Main.java:1: error: ';' expected import java.io*; ^ 1 error
s967651677
p00052
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; int count; while(!(line=br.readLine()).equals("0")){ int n=Integer.parseInt(line); count=0; for(int i=1;i<=6;i++){ int d=Math.pow(5,i); if(n<d...
Main.java:12: error: incompatible types: possible lossy conversion from double to int int d=Math.pow(5,i); ^ 1 error
s568631636
p00052
Java
import java.util.*; import java.math.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String args[]) { while(true) { int N = sc.nextLong(); if(N == 0) break; BigInteger bi = new BigInteger("1"); for(int i = 2; i <= N; i++) { bi = bi.multiply(new BigInteger...
Main.java:8: error: incompatible types: possible lossy conversion from long to int int N = sc.nextLong(); ^ 1 error
s152121269
p00052
Java
#include <iostream> using namespace std; int main(){ int n; int ans = 0; while(1){ ans = 0; cin >> n; if(n == 0)break; while(n){ n = n/5; ans += n; } cout << ans << endl; } }
Main.java:1: error: illegal character: '#' #include <iostream> ^ Main.java:1: error: class, interface, enum, or record expected #include <iostream> ^ Main.java:9: error: not a statement cin >> n; ^ Main.java:15: error: not a statement cout << ans << endl; ^ Main.java:4: error: u...
s669505767
p00052
Java
import java.util.*; public class MAIN{ public static void main(String[] args){ int n; Scanner scan = new Scanner(System.in); while(true){ n = scan.nextInt(); if(n == 0){ break; } System.out.println("" + aoj0052(n)); } } static int aoj0052(int n){ int res = 0, m = 0; for(int i = n;i / 5 !...
Main.java:3: error: class MAIN is public, should be declared in a file named MAIN.java public class MAIN{ ^ 1 error
s553790227
p00052
Java
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(true){ int n=sc.nextInt(); if(n==0){ break; } BigInteger fact=new BigInteger("1"); for(;n>=1;n--){ fact=fact.multiply(new BigInteger(String.valueOf(n))); } cha...
Main.java:10: error: cannot find symbol BigInteger fact=new BigInteger("1"); ^ symbol: class BigInteger location: class Main Main.java:10: error: cannot find symbol BigInteger fact=new BigInteger("1"); ^ symbol: class BigInteger location: class Main Main.java:12: error: canno...
s803297084
p00052
C
main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);} | ^~~~ main.c: In function 'main': main.c:1:20: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | main(){for(int n,s;scanf("%...
s792808430
p00052
C
#include <stdio.h> int main(void){ __int64 n , sum; int i; while(1){ sum = 0; scanf("%lld" , &n); if(n == 0) break; for(;n>=5;){ sum += n / 5; n /= 5; } printf("%d\n" , sum); } return 0; }
main.c: In function 'main': main.c:4:9: error: unknown type name '__int64'; did you mean '__int64_t'? 4 | __int64 n , sum; | ^~~~~~~ | __int64_t
s740051658
p00052
C
include<stdio.h> main(){ int n; while(scanf("%d",&n)!=EOF){ if(n/4-1<=0){ printf("0\n"); } else{ printf("%d\n",n/4-1); } } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s159977642
p00052
C
#include<stdio.h> int main(void) { int n,i,x,count; while(1){ scanf("%d",&n); if(n==0)break; count=0 for(i=5;i<=n;i+=5){ x=i; while(x%5==0){ count++; x/5; } printf("%d\n",count); } return 0; }
main.c: In function 'main': main.c:9:12: error: expected ';' before 'for' 9 | count=0 | ^ | ; 10 | for(i=5;i<=n;i+=5){ | ~~~ main.c:20:1: error: expected declaration or statement at end of input 20 | } | ^
s681005439
p00052
C
#include<stdio.h> int main(void) { int n,i,x,count; while(1){ scanf("%d",&n); if(n==0)break; count=0; for(i=5;i<=n;i+=5){ x=i; while(x%5==0){ count++; x/5; } printf("%d\n",count); } return 0; }
main.c: In function 'main': main.c:20:1: error: expected declaration or statement at end of input 20 | } | ^
s157347402
p00052
C++
#include<ios> int n,c; main() { while(scanf("%d",&n),n) { c=0; while(n>4)c+=n/=5,; printf("%d\n",c); } }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main() | ^~~~ a.cc: In function 'int main()': a.cc:8:27: error: expected primary-expression before ';' token 8 | while(n>4)c+=n/=5,; | ^
s665395578
p00052
C++
#include <iostream> #include <iomanip> #include <algorithm> #include <map> #include <string> #include <cstdio> #include <vector> #include <cstdio> using namespace std; #define rep(i,n) for(LL i=0;i<n;i++) #define all(v) (v).begin(),(v).end() #define MOD 1000000007 const int INF = INT_MAX; typedef long long LL; int fiv...
a.cc:13:17: error: 'INT_MAX' was not declared in this scope 13 | const int INF = INT_MAX; | ^~~~~~~ a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 8 | #include <cstdio> +++ |+#include <climits> 9 | using namespace st...
s499847518
p00052
C++
#include <iostream> int main(){ int n; while(std:cin>>n , n){ int sum=0, mul=5; while(n>=mul){ sum+=n/mul; mul*=5; } std::cout << sum << std::endl; } }
a.cc: In function 'int main()': a.cc:5:18: error: found ':' in nested-name-specifier, expected '::' 5 | while(std:cin>>n , n){ | ^ | ::
s738817869
p00052
C++
using System; class _0052 { public static void Main() { int n, sum; while ((n = int.Parse(Console.ReadLine())) != 0) { sum = 0; for (float b = 5; b <= n; b *= 5) sum += (int)(n / b); Console.WriteLine(sum); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:4:11: error: expected ':' before 'static' 4 | public static void Main() { | ^~~~~~~ | : a.cc:14:2: error: expected ';' after class definition 14 | } | ^ ...
s920315577
p00052
C++
#include "iostream" using namespace std int main(){ int a; while(a << cin){ int t1 = a / 10; int t2 = a / 5; cout << t1 + t2; } return 0; }
a.cc:3:20: error: expected ';' before 'int' 3 | using namespace std | ^ | ; 4 | 5 | int main(){ | ~~~ a.cc: In function 'int main()': a.cc:7:17: error: no match for 'operator<<' (operand types are 'int' and 'std::istream' {aka 'std::b...
s945783965
p00052
C++
#include "iostream" using namespace std; int main(){ int a; while(a << cin){ int t1 = a / 10; int t2 = a / 5; cout << t1 + t2; } return 0; }
a.cc: In function 'int main()': a.cc:6:17: error: no match for 'operator<<' (operand types are 'int' and 'std::istream' {aka 'std::basic_istream<char>'}) 6 | while(a << cin){ | ~ ^~ ~~~ | | | | int std::istream {aka std::basic_istream<char>} a....
s573462660
p00052
C++
#include<iostream> using namespace std; int main(){ int n; int x,y; for(){ cin >> n; if(n == 0) return 0; x = n / 5; for(int i=1;i<=x; i++){ y += i; } cout << y << endl; } }
a.cc: In function 'int main()': a.cc:8:9: error: expected primary-expression before ')' token 8 | for(){ | ^ a.cc:20:1: error: expected primary-expression before '}' token 20 | } | ^ a.cc:18:6: error: expected ';' before '}' token 18 | } | ^ | ; 19 | 20...
s091871324
p00052
C++
#include<iostream> using namespace std; int main(){ int n; int x,y; for(){ cin >> n; if(n == 0) return 0; x = n / 5; for(int i=1;i<=x; i++){ y += i; } cout << y << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: expected primary-expression before ')' token 8 | for(){ | ^ a.cc:20:5: error: expected primary-expression before 'return' 20 | return 0; | ^~~~~~ a.cc:18:6: error: expected ';' before 'return' 18 | } | ^ | ...
s495645699
p00052
C++
#include<iostream> #include<stdio.h> #include<string> #include<math.h> #include<iomanip> #include<algorithm> #include<string.h> #include<cctype> #include<map> #include<set> #include<vector> #include<sstream> #include<stack> #include<queue> #include<deque> #include<functional> #include<utility> using...
a.cc:48:4: error: expected unqualified-id before 'return' 48 | return 0; | ^~~~~~ a.cc:49:2: error: expected declaration before '}' token 49 | } | ^
s596696299
p00052
C++
#include <stdio.h> int max(int a,int b){ if(a>b)return a; return b; } int main(){ int n,a,b,temp; while(1){ scanf("%d",&n); if(n==0)return 0; a=b=0; for(int i=2;i<n;i++){ temp=i; while(temp%2){ temp/=2; a++; } while(temp%5){ temp/=5;b++; } } printf("%d\n",max(a,b); } }
a.cc: In function 'int main()': a.cc:23:23: error: expected ')' before ';' token 23 | printf("%d\n",max(a,b); | ~ ^ | )
s295128822
p00052
C++
#include<cstdio>main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
a.cc:1:21: warning: extra tokens at end of #include directive 1 | #include<cstdio>main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);} | ^ a.cc:1:9: fatal error: cstdio>mai: No such file or directory 1 | #include<cstdio>main(){for(int n,s;scanf("%d",&n)&&n;printf(...
s475835290
p00052
C++
n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
a.cc:1:1: error: 'n' does not name a type 1 | n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);} | ^ a.cc:1:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);} | ^~~~ a.cc:...
s364642898
p00052
C++
main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);} | ^~~~ a.cc: In function 'int main()': a.cc:1:8: error: 'n' was not declared in this scope 1 | main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s...
s898974355
p00052
C++
main(){int n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){int n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);} | ^~~~ a.cc: In function 'int main()': a.cc:1:21: error: 'scanf' was not declared in this scope 1 | main(){int n,s;for(;scanf("%d",&n)&&n;pr...
s390692975
p00052
C++
main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);} | ^~~~ a.cc: In function 'int main()': a.cc:1:12: error: 'n' was not declared in this scope 1 | main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s)...
s597319938
p00052
C++
a;main(n){for(;scanf("%d",&n),n;printf("%d\n",a))for(a=0;n;a+=n/=5);}
a.cc:1:1: error: 'a' does not name a type 1 | a;main(n){for(;scanf("%d",&n),n;printf("%d\n",a))for(a=0;n;a+=n/=5);} | ^ a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token 1 | a;main(n){for(;scanf("%d",&n),n;printf("%d\n",a))for(a=0;n;a+=n/=5);} | ^
s681787097
p00052
C++
#include <iostream> using namespace std; int main(){int n,c,t,f,i;for(;;){cin>>n;if(!n){break;}c=0;t=0;f=0;for(i=1;i<=n;i++){int m=i;while(m%2==0){t++;m/=2;}m=i;while(m%5==0){f++;m/=5;}}cout<<t<f?t:f<<endl;}return 0;}
a.cc: In function 'int main()': a.cc:3:153: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and 'int') 3 | int main(){int n,c,t,f,i;for(;;){cin>>n;if(!n){break;}c=0;t=0;f=0;for(i=1;i<=n;i++){int m=i;while(m%2==0){t++;m/=2;}m=i;while(m%5==0){f++;m/=5;}}cout<<t<f?t:f<<endl;}return 0;} ...
s805859953
p00052
C++
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> using namespace std; int main() { unsigned long n,c5; while(1){ cin>>n; if(n==0) return 0; c5=0; for(unsigned long i=1;i<=n;i++){ unsigned long j=i; while(j%5==0){c5++;j/=5;} } else cou...
a.cc: In function 'int main()': a.cc:22:17: error: 'else' without a previous 'if' 22 | else cout<<c5<<endl; | ^~~~
s635680096
p00052
C++
#include <cstdio> using namespace std; int main(){ int n,sum; while(~scanf("%d",&n){ sum=0; while(n>4){ sum+=n/5; n/=5; } printf("%d\n",sum); } }
a.cc: In function 'int main()': a.cc:7:30: error: expected ')' before '{' token 7 | while(~scanf("%d",&n){ | ~ ^ | )
s477849618
p00052
C++
main() { long long int i,j,x; for(;scanf("%lld",&i),i;printf("%lld\n",j)) for(j=0,x=5;i/x;x*=5) j+=i/x; }
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main() | ^~~~ a.cc: In function 'int main()': a.cc:4:8: error: 'scanf' was not declared in this scope 4 | for(;scanf("%lld",&i),i;printf("%lld\n",j)) | ^~~~~ a.cc:4:27: error: 'printf' was not declared...
s468553419
p00052
C++
import java.util.*; public class MAIN{ public static void main(String[] args){ int n; Scanner scan = new Scanner(System.in); while(true){ n = scan.nextInt(); if(n == 0){ break; } System.out.println("" + aoj0052(n)); } } static int aoj0052(int n){ int res = 0, m = 0; for(int i = n;i / 5 !...
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:3:1: error: expected unqualified-id before 'public' 3 | public class MAIN{ | ^~~~~~
s969045135
p00053
Java
import java.util.Scanner; public class Main { static ArrayList<Integer> list=new ArrayList<>(); static boolean[] prime=new boolean[104730]; static void eratos() { for(int i=2; i<104730; i++) { prime[i]=true; } for(int i=2; i<104730; i++) { if(prime[i]) { list.add(i); for(int j=2; i*j<104730;...
Main.java:5: error: cannot find symbol static ArrayList<Integer> list=new ArrayList<>(); ^ symbol: class ArrayList location: class Main Main.java:5: error: cannot find symbol static ArrayList<Integer> list=new ArrayList<>(); ^ symbol: class ArrayList location: c...
s843666187
p00053
Java
import java.io.*; import java.math.BigInteger; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; int[] ps=new int[20000]; ps[1]=2 BigInteger x=BigInteger.valueOf(ps[1]); for(int i=2;i<20000;i++){ x=x.nextProba...
Main.java:9: error: ';' expected ps[1]=2 ^ 1 error
s865572218
p00053
Java
class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int input=0; int sosuko=0; long wa=0l; int genzai=0; boolean ss=false; while(sc.hasNext()) { input=sc.nextInt(); sosuko=0; wa=0l; genzai=0; if(input>=1) { wa+=2; genzai=2; sosuko=1; } ...
Main.java:4: error: cannot find symbol Scanner sc=new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc=new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s164736293
p00053
Java
import java.util.Scanner; public class Test { public static void main(String[] args){ Scanner scan = null; try{ int num; int[] prime = new int[10000]; prime[0] = 2; for(int i = 3 ,j = 1;j <prime.length;i += 2){ boolean check = false; for(int k = 3; k < i /2; k += 2){ if(i % k ==0){ ...
Main.java:4: error: class Test is public, should be declared in a file named Test.java public class Test { ^ 1 error
s777794806
p00053
C
#include <cstdio> #include <cmath> #include <iostream> using namespace std; int main(){ int n,m,sum,w; while(1){ cin >> n; if(n==0){ return 0; } m=0; sum=0; for(int t=2;m<n;t++){ w=0; for(int i=2;i<=sqrt(t);i++){ if(t%i==0){ w++; } } if(w==0){ sum+=t; m++; } } c...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s186816754
p00053
C
#include<stdio.h> #include<math.h> int main(){ int i,j,k; int sum,n,r,s[10000]; s[0]=2; for(i=3,j=1;j<10000;i+=2){ r=(int)sqrt(i)+1; for(k=3;k<r;k+=2){ if(i%k==0) r=0; } if(r){ s[j]=i; j++ } for(;;){ scanf("%d",&n); if(n==0) break; sum=0; for(i=0;i<n;i++) sum+=s[i]; printf("%d\n",sum); } return 0; }
main.c: In function 'main': main.c:15:4: error: expected ';' before '}' token 15 | j++ | ^ | ; 16 | } | ~ main.c:27:1: error: expected declaration or statement at end of input 27 | } | ^
s679366336
p00053
C
#include<stdio.h> #include<math.h> int main(){ int i,j,k; int sum,n,r,s[10000]; s[0]=2; for(i=3,j=1;j<10000;i+=2){ r=(int)sqrt(i)+1; for(k=3;k<r;k+=2){ if(i%k==0) r=0; } if(r){ s[j]=i; j++; } for(;;){ scanf("%d",&n); if(n==0) break; sum=0; for(i=0;i<n;i++) sum+=s[i]; printf("%d\n",sum); } return 0; }
main.c: In function 'main': main.c:27:1: error: expected declaration or statement at end of input 27 | } | ^
s105160519
p00053
C
#include<stdio.h> #include<math.h> int main(){ int n; int a[10000]; int b; int i, j, p; int c[10000][2]; p = 1; while (true){ scanf("%d", &c[p][0]); if(c[p][0]!=0)p++; else break; } //p--; b = (int)pow(10000.0, 0.5); a[0] = -1; for (i = 2; i <= b; i++){ for (j = 2; j <= 10000/ i; j++){ a[i*...
main.c: In function 'main': main.c:11:16: error: 'true' undeclared (first use in this function) 11 | while (true){ | ^~~~ main.c:3:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 2 | #include<math.h> +++ |+#include <stdb...
s355877095
p00053
C
bool isPrime(int j){ int k = j; if(j < 2) return false; if(j == 2) return true; if(j % 2 == 0) return false; while(j >2){ if(k % (j-1) ==0 ) return false; j = j-1; } return true; } int main(void) { int s,n; for(;;){ int i,j=0; s = 0; scanf("%d",&n); for(i = 0; i<10000;i++){ if(isPrime(i+1)){ ...
main.c:1:1: error: unknown type name 'bool' 1 | bool isPrime(int j){ | ^~~~ main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' +++ |+#include <stdbool.h> 1 | bool isPrime(int j){ main.c: In function 'isPrime': main.c:3:26: error: 'false...
s737767217
p00053
C
int main(void) { int sosuu[10000]; int i,j,k,l,n,sum,flag; k=1; sosuu[0]=2; for(i=3;i<=10000;i+=2){ flag=0; for(j=2;j<i;j++){ if(i%j==0){ flag=1; break; } } if(flag==0){ sosuu[k]=i; k++; } } while(scanf("%d",&n)!=EOF){ sum=0; for(l=0;l<n;l++){ su...
main.c: In function 'main': main.c:20:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 20 | while(scanf("%d",&n)!=EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:20:9: ...
s596931148
p00053
C
int main(void) { int sosuu[20000]; int i,j,k,l,n,sum,flag; k=1; sosuu[0]=2; for(i=3;i<=110000;i+=2){ flag=0; for(j=2;j<i;j++){ if(i%j==0){ flag=1; break; } } if(flag==0){ sosuu[k]=i; k++; } } while(scanf("%d",&n)!=EOF){ sum=0; for(l=0;l<n;l++){ s...
main.c: In function 'main': main.c:20:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 20 | while(scanf("%d",&n)!=EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:20:9: ...
s965131118
p00053
C
#include<stdio.h> int main(void) { ????int sosuu[10001]; ????int i,j,k,l,n,sum,flag; ????k=1; ????sosuu[0]=2; ????for(i=3;i<=110000;i+=2){ ????????flag=0; ????????for(j=2;j<i;j++){ ????????????if(i%j==0){ ????????flag=1; ????????break; ????????????} ????????} ????????if(flag==0){ ????????????sosuu[k]=i; ????????????k++...
main.c: In function 'main': main.c:4:1: error: expected expression before '?' token 4 | ????int sosuu[10001]; | ^ main.c:5:1: error: expected expression before '?' token 5 | ????int i,j,k,l,n,sum,flag; | ^ main.c:6:1: error: expected expression before '?' token 6 | ????k=1; | ^ main.c:6:5:...
s809086999
p00053
C
#include<stdio.h> int main(void) { ????int sosuu[10001]; ????int i,j,k,l,n,sum,flag; ????k=1; ????sosuu[0]=2; ????for(i=3;i<=110000;i+=2){ ????????flag=0; ????????for(j=2;j<i;j++){ ????????????if(i%j==0){ ????????flag=1; ????????break; ????????????} ????????} ????????if(flag==0){ ????????????sosuu[k]=i; ????????????k++...
main.c: In function 'main': main.c:4:1: error: expected expression before '?' token 4 | ????int sosuu[10001]; | ^ main.c:5:1: error: expected expression before '?' token 5 | ????int i,j,k,l,n,sum,flag; | ^ main.c:6:1: error: expected expression before '?' token 6 | ????k=1; | ^ main.c:6:5:...
s568401812
p00053
C
int main(void) { int sosuu[10001]; int i,j,k,l,n,sum,flag; k=1; sosuu[0]=2; sosuu[2]=3; for(i=5;i<=110000;i+=2){ flag=0; for(j=3;j<i;j+=2){ if(i%j==0){ flag=1; break; } } if(flag==0){ sosuu[k]=i; k++; } if(k==10000){ break; } } while(scanf("%d"...
main.c: In function 'main': main.c:24:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 24 | while(scanf("%d",&n)!=EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:24:9: ...
s244424966
p00053
C
int main(void) { int sosuu[10001]; int i,j,k,l,n,sum,flag; k=1; sosuu[0]=2; sosuu[1]=3; for(i=5;i<=110000;i+=2){ flag=0; for(j=3;j<i;j+=2){ if(i%j==0){ flag=1; break; } } if(flag==0){ sosuu[k]=i; k++; } if(k==10000){ break; } } while(scanf("%d"...
main.c: In function 'main': main.c:24:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 24 | while(scanf("%d",&n)!=EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:24:9: ...
s798971509
p00053
C
#include<stdio.h> int main(void) { ????int sosuu[10001]; ????int i,j,k,l,n,sum,flag; ????k=1; ????sosuu[0]=2; ????sosuu[1]=3; ????for(i=5;i<=120000;i+=2){ ????????flag=0; ????????for(j=3;j<i;j+=2){ ????????????if(i%j==0){ ????????flag=1; ????????break; ????????????} ????????} ????????if(flag==0){ ????????????sosuu[k]=i...
main.c: In function 'main': main.c:4:1: error: expected expression before '?' token 4 | ????int sosuu[10001]; | ^ main.c:5:1: error: expected expression before '?' token 5 | ????int i,j,k,l,n,sum,flag; | ^ main.c:6:1: error: expected expression before '?' token 6 | ????k=1; | ^ main.c:6:5:...
s561188802
p00053
C
#include <stdio.h> int IsPrime(void); int main(void){ int n , p[10001] , count = 2 , sum_p[10001]; p[1] = 2; for(n=3;count<=10000;n+=2){ if(IsPrime(n)){ p[count] = n; count++; } } sum_p[1] = 2; for(n=1;n<10000;n++){ sum_p[n+1] = sum_p[n] + p[n+1]; } while(1){ scanf("%d" , &n); if(n==0) break; ...
main.c: In function 'main': main.c:9:20: error: too many arguments to function 'IsPrime' 9 | if(IsPrime(n)){ | ^~~~~~~ main.c:3:5: note: declared here 3 | int IsPrime(void); | ^~~~~~~ main.c: At top level: main.c:26:5: error: conflicting types for 'IsPrime'; ha...
s461961703
p00053
C
促袖#include<stdio.h> main() { int x, y, n, s,cnt = 0,count; int a[1000000] = {0}; for(x = 2;x < 1000000;x++){ for(y = x + x;y < 1000000;y += x){ a[y] = 1; } } while(1){ scanf("%d", &n); if(n==0) break; count=0; x=2; s=0; while(count<n){ if(a[x]==0){ s+=x;...
main.c:1:5: error: stray '#' in program 1 | 促袖#include<stdio.h> | ^ main.c:1:1: error: unknown type name '\U00004fc3\U00008896' 1 | 促袖#include<stdio.h> | ^~~~ main.c:1:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | 促袖#include<stdio.h> | ^
s523439779
p00053
C
#include<stdio.h> #include<string.h> int n,s,c,f,h,i,k=0; int p[10010]; bool j[1000000]; int main(){ memset(j,true,1000000); for(i=2;k<10000;i++){ if(j[i]==true){ p[k]=i; k++; for(h=2;h*i<1000000;h++){ j[h*i]=false; } } } scanf("%d",&n); while(n!=0){s=0; for(i=0;i<n;i++)s+=p[i]; printf("...
main.c:6:1: error: unknown type name 'bool' 6 | bool j[1000000]; | ^~~~ main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 2 | #include<string.h> +++ |+#include <stdbool.h> 3 | main.c: In function 'main': main.c:8:18: error: 'true'...
s211893731
p00053
C
#include<stdio.h> #define P_EDGE 200000 int makelist(int* list,int kazu){ int i,j; for(i=0;i<kazu;i++){ list[i]=1; } list[0]=0; list[1]=0; for(i=2;i<kazu;i++){ if(list[i]){ for(j=2*i;j<kazu;j+=i){ list[j]=0; } } } return 0...
main.c: In function 'main': main.c:24:26: error: expected ';' before 'int' 24 | long long int ans | ^ | ; 25 | int i; | ~~~ main.c:29:17: error: 'ans' undeclared (first use in this function) 29 | ...
s226934001
p00053
C
#include <stdio.h> #define DATA 1000000 int prime[DATA]; int is_prime(int n){ int i; if(n < 2) return 0; for(i = 2 ; i*i <= n ; i++){ if(n % i == 0) return 0; } return 1; } void judge(){ int i; for(i = 0 ; i < SIZE ; i++) prime[i] = is_prime(i); return; } int main(void){ int n,i,sum; j...
main.c: In function 'judge': main.c:18:19: error: 'SIZE' undeclared (first use in this function) 18 | for(i = 0 ; i < SIZE ; i++) prime[i] = is_prime(i); | ^~~~ main.c:18:19: note: each undeclared identifier is reported only once for each function it appears in
s768511406
p00053
C
#include <stdio.h> #define DATA 1000000 int prime[DATA]; int is_prime(int n){ int i; if(n < 2) return 0; for(i = 2 ; i <= n ; i++){ if(n % i == 0) return 0; } return 1; } void judge(){ int i; for(i = 0 ; i < SIZE ; i++) prime[i] = is_prime(i); return; } int main(void){ int n,i,sum; jud...
main.c: In function 'judge': main.c:18:19: error: 'SIZE' undeclared (first use in this function) 18 | for(i = 0 ; i < SIZE ; i++) prime[i] = is_prime(i); | ^~~~ main.c:18:19: note: each undeclared identifier is reported only once for each function it appears in
s853565129
p00053
C++
#include <iostream> #include <string> using namespace std; int main() { int num[104730], Pnum[10000], n, ans; int k = 0; memset(Pnum, 1, sizeof(int)); for (int i = 2; i < 104730; i++) { if (num[i]) { Pnum[k] = i; k++; for (int j = i + i; j < 104730; j+=i) { num[j] = 0; } } } while (cin >>...
a.cc: In function 'int main()': a.cc:11:9: error: 'memset' was not declared in this scope 11 | memset(Pnum, 1, sizeof(int)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <...
s304721201
p00053
C++
#include<stdio.h> #include<math.h> int main(){ bool N[10002]; for(int i=0;i<10001;i++) N[i]=false; for(int i=3;i<=10001;i+=2) for(int j=2;j<=sqrt((double)i);j++) {if(i%j==0){N[i]=false;}else{N[i]=true}} N[2]=true;N[3]=true; int n; while(1){ scanf("%d",&n);if(n==0)break; int s=0; for(int i=0;i<=n;i++) if(N[i]=true...
a.cc: In function 'int main()': a.cc:12:39: error: expected ';' before '}' token 12 | {if(i%j==0){N[i]=false;}else{N[i]=true}} | ^ | ;
s239220066
p00053
C++
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n,s; boolean is; while(sc.hasNextInt()){ n = sc.nextInt(); if(n == 0)break; s = 0; for(int i = 2; n != 0; i++){ is = true; for(i...
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:4:15: error: expected ':' before 'static' 4 | public static void main(String[] args){ | ^~~~~~~ | : a...
s357637287
p00053
C++
#include<cstdio> #include<math> using namespace std; int main(){ int n,i,j,p[10000],sum=0; while(scanf("%d",&n)!=0){ for(i=2;;i++){ for(j=2;j<=sqrt(i);j++){ if(i%j==0)break; if(j==(int)sqrt(i)){p[n]=i;n--;break;} } if(n==0)break; } for(i=n;i>0;i--){sum += p[i];} printf("%d",&sum); } }
a.cc:2:9: fatal error: math: No such file or directory 2 | #include<math> | ^~~~~~ compilation terminated.
s067382985
p00053
C++
#include<cstdio> #include<math> using namespace std; int main(){ int n,i,j,p[10000],sum=0; while(scanf("%d",&n)!=0){ for(i=2;;i++){ for(j=2;j<=sqrt(i);j++){ if(i%j==0)break; if(j==(int)sqrt(i)){p[n]=i;n--;break;} } if(n==0)break; } for(i=n;i>0;i--){sum += p[i];} printf("%d",sum); } }
a.cc:2:9: fatal error: math: No such file or directory 2 | #include<math> | ^~~~~~ compilation terminated.