submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s758292151
p02255
C++
#include <bits/stdc++.h> #include <numeric> #include<iostream> #include<vector> #include<algorithm> using namespace std; void trace(int a[],int n){ for(int i=0;i<n;i++){ if(i>0) cout << " " << a[i]; } cout << endl; } void insertionsort(int a[],int n){ int j,v; for(int i=1;i<n;i++){ ...
a.cc: In function 'int main()': a.cc:34:11: error: cannot convert 'std::vector<int>' to 'int*' 34 | trace(a,n); | ^ | | | std::vector<int> a.cc:8:16: note: initializing argument 1 of 'void trace(int*, int)' 8 | void trace(int a[],int n){ | ~~...
s702127042
p02255
C++
#include <bits/stdc++.h> #include <numeric> #include<iostream> #include<vector> #include<algorithm> using namespace std; int trace(){ for(int i=0;i<n;i++){ if(i>0) cout << " " << a[i]; } cout << endl; } int main(){ int n; vector<int> a(n); cin >> n; for(int i=0;i<n;i++) cin >> a[i]...
a.cc: In function 'int trace()': a.cc:9:19: error: 'n' was not declared in this scope 9 | for(int i=0;i<n;i++){ | ^ a.cc:10:32: error: 'a' was not declared in this scope 10 | if(i>0) cout << " " << a[i]; | ^ a.cc:13:1: warning: no return st...
s537854364
p02255
C++
#include <bits/stdc++.h> #include <numeric> #include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int n; vector<int> a(n); cin >> n; for(int i=0;i<n;i++) cin >> a[i]; for(int i=0;i<n;i++){ if(i>0) cout << " " << a[i]; } cout << endl; for(int ...
a.cc: In function 'int main()': a.cc:20:9: error: 'v' was not declared in this scope 20 | v=a[i]; | ^
s211461881
p02255
C++
#include <bits/stdc++.h> #include <numeric> #include<iostream> #include<vector> #include<algorithm> using namespace std; int trace(){ for(int i=0;i<n;i++){ if(i>0) cout << " "; cout << a[i]; } cout << endl; } int main(){ int n; vector<int> a(n); cin >> n; for(int i=0;i<n;i+...
a.cc: In function 'int trace()': a.cc:9:19: error: 'n' was not declared in this scope 9 | for(int i=0;i<n;i++){ | ^ a.cc:11:17: error: 'a' was not declared in this scope 11 | cout << a[i]; | ^ a.cc:14:1: warning: no return statement in function returning ...
s233160304
p02255
C++
#include <bits/stdc++.h> #include <numeric> #include<iostream> #include<vector> #include<algorithm> using namespace std; int trace(){ int n; for(int i=0;i<n;i++){ if(i>0) cout << " "; cout << a[i]; } cout << endl; } int main(){ int n; vector<int> a(n); cin >> n; for(int...
a.cc: In function 'int trace()': a.cc:12:17: error: 'a' was not declared in this scope 12 | cout << a[i]; | ^ a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type] 15 | } | ^
s844646740
p02255
C++
#include <iostream> using namespace std; int main(){ int n; cin>>n; vector<int> a(n); for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++){ int v=a[i]; int j=i-1; while(j>=0&&a[j]>v) { a[j+1]=a[j]; j--; } a[j+1]=v; for(int k=0;k<n-1;k++) cout<<a[k]<<" "; cout << a[n-1...
a.cc: In function 'int main()': a.cc:7:3: error: 'vector' was not declared in this scope 7 | vector<int> a(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using ...
s186024169
p02255
C++
#include <bits/stdc++.h> #include <numeric> #include<iostream> #include<vector> #include<algorithm> using namespace std; void trace(int a[],int n){ for(int i=0;i<n;i++){ if(i>0) cout << " "; } cout << endl; } void insertionsort(int a[],int n){ for(i=1;i<n;i++){ int v=a[i]; int ...
a.cc: In function 'void insertionsort(int*, int)': a.cc:16:9: error: 'i' was not declared in this scope 16 | for(i=1;i<n;i++){ | ^ a.cc:19:19: error: expected ')' before ';' token 19 | while(j>=0;&&a[j]>v){ | ~ ^ | ) a.cc:19:23: error: expect...
s003145642
p02255
C++
#include <bits/stdc++.h> #include <numeric> #include<iostream> #include<vector> #include<algorithm> using namespace std; void trace(int a[],int n){ for(int i=0;i<n;i++){ if(i>0) cout << " "; } cout << endl; } void insertionsort(int a[],int n){ for(i=1;i<n;i++){ int v=a[i]; int ...
a.cc: In function 'void insertionsort(int*, int)': a.cc:16:9: error: 'i' was not declared in this scope 16 | for(i=1;i<n;i++){ | ^ a.cc:19:19: error: expected ')' before ';' token 19 | while(j>=0;&&a[j]>v){ | ~ ^ | ) a.cc:19:23: error: expect...
s000436049
p02255
C++
#include <iostream> static const int maxN = 100; void printarray(int* array,int length) { for(i = 0; i < length; i++) { printf("%d",array[i]); } printf("\n"); } void insertionSort(int* array, int length) { for(i = 1; i < length; i++) { key = array[i]; int j = i - 1; for(; j >= 0 & array[j]...
a.cc: In function 'void printarray(int*, int)': a.cc:6:7: error: 'i' was not declared in this scope 6 | for(i = 0; i < length; i++) | ^ a.cc: In function 'void insertionSort(int*, int)': a.cc:15:7: error: 'i' was not declared in this scope 15 | for(i = 1; i < length; i++) | ^ a.cc:17:...
s573843110
p02255
C++
#include <iostream> using namespace std; static const int maxN = 100; void printarray(int* array,int length) { for(int i = 0; i < length; i++) { printf("%d",array[i]); } printf("\n"); } void insertionSort(int* array, int length) { printarray(array,length); for(int i = 1; i < length; i++) { ...
a.cc: In function 'int main()': a.cc:46:3: error: return-statement with no value, in function returning 'int' [-fpermissive] 46 | return ; | ^~~~~~
s564153311
p02255
C++
#include <iostream> #include <stdio.h> using namespace std; static const int maxN = 100; void printarray(int* array,int length) { for(int i = 0; i < length; i++) { printf("%d",array[i]); } printf("\n"); } void insertionSort(int* array, int length) { printarray(array,length); for(int i = 1; i < leng...
a.cc: In function 'int main()': a.cc:48:3: error: return-statement with no value, in function returning 'int' [-fpermissive] 48 | return ; | ^~~~~~
s761238345
p02255
C++
#include <iostream> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) void print_A(int *A, int N) { REP(i, N) { cout << A[i]; if (i != N-1) cout << " " } cout << endl; return; } void insertionSort(int *A, int ...
a.cc: In function 'void print_A(int*, int)': a.cc:12:34: error: expected ';' before '}' token 12 | if (i != N-1) cout << " " | ^ | ; 13 | } | ~
s650888184
p02255
C++
#include<iostream> using namespace std; int main(){ int n, a[101]; cin << n; for(int i = 0; i < n; ++i){ con << a[i]; } for(int i = 0; i < n; i++){ for(int j = i; j > 0; --j){ if(a[i-1] > a[i]){ int b = a[i];a[i]=a[i-1];a[i-1]=b; } } for(int j = 0; j < n; ++j) cout <<...
a.cc: In function 'int main()': a.cc:7:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | cin << n; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:7:7: note: candidate: 'operat...
s371721741
p02255
C++
#include <iostream> using namespace std; int main(){ int n, a[101]; cin << n; for(int i = 0; i < n; ++i){ cin << a[i]; } for(int i = 0; i < n; i++){ for(int j = i; j > 0; --j){ if(a[i-1] > a[i]){ int b = a[i];a[i]=a[i-1];a[i-1]=b; } } for(int j = 0; j < n; ++j) cout <<...
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin << n; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:7: note: candidate: 'operat...
s463384850
p02255
C++
#include<stdio.h> void trace(int A[],int N){ int i; for(i=0;i<N;i++){ if(i>0){ printf(" "); } printf("%d",A[i]); } printf("\n"); } void insertionSort(int A[],int N){ int j,i,v; for(i=1;i<N;i++){ v=A[i]; j=i-1; while(j>=0&&A[j]>v){ A[j+1]=A[j]; j--; } A[j+1]=v; trace(A,N); } } int main(){ int N,i,j; int A[100]; scanf(...
a.cc: In function 'int main()': a.cc:32:18: error: expected ';' before '}' token 32 | scanf("%d",&A[i]) | ^ | ; 33 | } | ~
s447092797
p02255
C++
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> v(N,0); for(auto&& x: v){ cin >> x; } for(int i=1; i<n; ++i){ int x = v[i]; int j=i-1; while( j>=0 and v[j]>x ){ v[j+1]=v[j]; --j; ...
a.cc: In function 'int main()': a.cc:10:19: error: 'N' was not declared in this scope 10 | vector<int> v(N,0); | ^
s222002888
p02255
C++
#include<iostream> #include<cstdio> using namespace std; void trace(int A[], int N) { for (int i = 0; i < N; i++) { if (i != N - 1) { printf("%d ",A[i]); } else { printf("%d\n", A[i]); } } } void sort(int A[], int N) { for (int i = 1; i < N; i++) { int v = A[i]; int j = i - 1; while (j >= 0 ...
a.cc: In function 'int main()': a.cc:42:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 42 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s596544353
p02255
C++
#include<iostream.h> int main() { int A[100],i_1=0,i_2=0,i_3=0,i_4=0,key=0,k; cin>>i_1; i_3=i_1; while(i_1>0) { cin>>A[i_2++]; i_1--; } for(i_1=1;i_1<i_3;i_1++) { key=A[i_1]; i_2=i_1-1; while(i_2>=0 && A[i_2]>key) { A[i_2+1]=A[i_2]; i_2--; } A[i_2+1]=key; while(i_4<i_3) cout<<A[i_4++]<<" "; ...
a.cc:1:9: fatal error: iostream.h: No such file or directory 1 | #include<iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s007679177
p02255
C++
#include <iostream> using namespace std; int main() { int array[100],q,i,j,k; cin >> q; for(i=0;i<q;i++) cin >> array[i]; for(i=1;i<array.length-1;i++){ key = array[i]; j = i-1; while(j>=0&&array[j]>key){ array[j+1]=array[j]; j--; a[j...
a.cc: In function 'int main()': a.cc:10:21: error: request for member 'length' in 'array', which is of non-class type 'int [100]' 10 | for(i=1;i<array.length-1;i++){ | ^~~~~~ a.cc:11:9: error: 'key' was not declared in this scope 11 | key = array[i]; | ^~~ a.cc:...
s767534706
p02255
C++
#include <iostream> using namespace std; int main() { int q,i,j,k,key; char array[100]; cin >> q; for(i=0;i<q;i++) cin >> array[i]; for(i=1;i<array.length-1;i++){ key = array[i]; j = i-1; while(j>=0&&array[j]>key){ array[j+1]=array[j]; j--; ...
a.cc: In function 'int main()': a.cc:11:21: error: request for member 'length' in 'array', which is of non-class type 'char [100]' 11 | for(i=1;i<array.length-1;i++){ | ^~~~~~
s775833534
p02255
C++
#include <iostream> #include <string> using namespace std; int main() { int q,i,j,k,key; string array; cin >> q; for(i=0;i<q;i++) cin >> array[i]; for(i=1;i<array.length-1;i++){ key = array[i]; j = i-1; while(j>=0&&array[j]>key){ array[j+1]=array[j]; ...
a.cc: In function 'int main()': a.cc:11:21: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns...
s257259575
p02255
C++
#include <iostream> #include <stdio.h> using namespace std; static const int N = 100; void output(int input[], int n){ for(int i = 0; i < n; i++ ){ if(i > 0) printf(" "); printf("%d",input[i]); } printf("\n"); } int main(void){ int n,input[N],selectNumber; cin >> n; for(int i = 0; i < n; i++){ cin >> i...
a.cc: In function 'int main()': a.cc:25:22: error: 'p' was not declared in this scope 25 | output(input,p); | ^
s020629419
p02255
C++
#include <iostream> #include <vector> using namespace std; void fnInsertionSort(vector<int>&, int); void fnTrace(vector<int>); int main() { vector<int> viSort; int iMaxSize; cin >> iMaxSize; viSort.resize( iMaxSize ); for (int i = 0; i < iMaxSize; i++) cin >> viSort[i]; fnTrace(viSort, iMaxSize); i...
a.cc: In function 'int main()': a.cc:17:10: error: too many arguments to function 'void fnTrace(std::vector<int>)' 17 | fnTrace(viSort, iMaxSize); | ~~~~~~~^~~~~~~~~~~~~~~~~~ a.cc:6:6: note: declared here 6 | void fnTrace(vector<int>); | ^~~~~~~ a.cc:18:3: error: 'insertionSort' was not decl...
s418884959
p02255
C++
#include <iostream> #include <vector> using namespace std; void fnInsertionSort(vector<int>&, int); void fnTrace(vector<int>); int main() { vector<int> viSort; int iMaxSize; cin >> iMaxSize; viSort.resize( iMaxSize ); for (int i = 0; i < iMaxSize; i++) cin >> viSort[i]; fnTrace(viSort, iMaxSize); i...
a.cc: In function 'int main()': a.cc:17:10: error: too many arguments to function 'void fnTrace(std::vector<int>)' 17 | fnTrace(viSort, iMaxSize); | ~~~~~~~^~~~~~~~~~~~~~~~~~ a.cc:6:6: note: declared here 6 | void fnTrace(vector<int>); | ^~~~~~~ a.cc:18:3: error: 'insertionSort' was not decl...
s098335207
p02255
C++
#include <iostream> #include <vector> using namespace std; void fnInsertionSort(vector<int>&, int); void fnTrace(vector<int>); int main() { vector<int> viSort; int iMaxSize; cin >> iMaxSize; viSort.resize( iMaxSize ); for (int i = 0; i < iMaxSize; i++) cin >> viSort[i]; fnTrace(viSort, iMaxSize); i...
a.cc: In function 'int main()': a.cc:17:10: error: too many arguments to function 'void fnTrace(std::vector<int>)' 17 | fnTrace(viSort, iMaxSize); | ~~~~~~~^~~~~~~~~~~~~~~~~~ a.cc:6:6: note: declared here 6 | void fnTrace(vector<int>); | ^~~~~~~ a.cc:18:3: error: 'insertionSort' was not decl...
s495447287
p02255
C++
#include <iostream> #include <vector> using namespace std; void fnInsertionSort(vector<int>&, int); void fnTrace(vector<int>); int main() { vector<int> viSort; int iMaxSize; cin >> iMaxSize; viSort.resize( iMaxSize ); for (int i = 0; i < iMaxSize; i++) cin >> viSort[i]; fnTrace(viSort, iMaxSize); i...
a.cc: In function 'int main()': a.cc:17:10: error: too many arguments to function 'void fnTrace(std::vector<int>)' 17 | fnTrace(viSort, iMaxSize); | ~~~~~~~^~~~~~~~~~~~~~~~~~ a.cc:6:6: note: declared here 6 | void fnTrace(vector<int>); | ^~~~~~~ a.cc:18:3: error: 'insertionSort' was not decl...
s960962999
p02255
C++
#include <iostream> #include <vector> using namespace std; void fnInsertionSort(vector<int>&, int); void fnTrace(vector<int>, int); int main() { vector<int> viSort; int iMaxSize; cin >> iMaxSize; viSort.resize( iMaxSize ); for (int i = 0; i < iMaxSize; i++) cin >> viSort[i]; fnTrace(viSort, iMaxSize)...
a.cc:48:2: error: expected unqualified-id before '-' token 48 | }- | ^
s693260118
p02255
C++
#include <iostream> #include <vector> using namespace std; void fnInsertionSort(vector<int>&, int); void fnTrace(vector<int>); int main() { vector<int> viSort; int iMaxSize; cin >> iMaxSize; viSort.resize( iMaxSize ); for (int i = 0; i < iMaxSize; i++) cin >> viSort[i]; fnTrace(viSort, iMaxSize); i...
a.cc: In function 'int main()': a.cc:17:10: error: too many arguments to function 'void fnTrace(std::vector<int>)' 17 | fnTrace(viSort, iMaxSize); | ~~~~~~~^~~~~~~~~~~~~~~~~~ a.cc:6:6: note: declared here 6 | void fnTrace(vector<int>); | ^~~~~~~ a.cc:18:3: error: 'insertionSort' was not decl...
s698757831
p02255
C++
#include <iostream> #include <vector> using namespace std; void fnTrace(vector<int> argviSort) { for (int i = 0; i < argviSort.size(); i++) { if (i) cout << " "; cout << argviSort[i]; } cout << endl; } void fnInsertionSort(vector<int> &argviSort) { for (int ixSorting = 1; ixSorting < argviSort.size...
a.cc: In function 'void fnInsertionSort(std::vector<int>&)': a.cc:21:32: error: 'iSorted' was not declared in this scope; did you mean 'ixSorted'? 21 | while (iTarget < argviSort[iSorted] && | ^~~~~~~ | ixSorted a.cc:27:15: error: 'iSorted...
s152744582
p02255
C++
#include<iostream> using namespace std; #define MAX 100 void insertionSort(int a[],int n){ for(i=1;i<n-1;i++){ v = a[i]; j = i - 1; while(j>=0&&a[j]>v){ a[j+1] = a[j]; j--; } a[j+1] = v; for(j=0;j<n;j++){ if(j>0) cout << " "; cout << a[j]; } cout << en...
a.cc: In function 'void insertionSort(int*, int)': a.cc:6:8: error: 'i' was not declared in this scope 6 | for(i=1;i<n-1;i++){ | ^ a.cc:7:6: error: 'v' was not declared in this scope 7 | v = a[i]; | ^ a.cc:8:6: error: 'j' was not declared in this scope 8 | j = i - 1; ...
s341963271
p02255
C++
#include<iostream> using namespace std; #define MAX 100 void insertionSort(int a[],int n){ int i,j,v; for(i=1;i<n-1;i++){ v = a[i]; j = i - 1; while(j>=0&&a[j]>v){ a[j+1] = a[j]; j--; } a[j+1] = v; for(j=0;j<n;j++){ if(j>0) cout << " "; cout << a[j]; } ...
a.cc: In function 'int main()': a.cc:34:20: error: expected primary-expression before ']' token 34 | insertionSort(a[],n); | ^
s541333059
p02255
C++
#include<iostream> using namespace std; #define MAX 100 void trace(a[],n){ int i,j; for(j=0;j<n;j++){ if(j>0) cout << " "; cout << a[j]; } cout << endl; } void insertionSort(int a[],int n){ int i,j,v; for(i=1;i<n-1;i++){ v = a[i]; j = i - 1; while(j>=0&&a[j]>v){ a...
a.cc:5:6: error: variable or field 'trace' declared void 5 | void trace(a[],n){ | ^~~~~ a.cc:5:12: error: 'a' was not declared in this scope 5 | void trace(a[],n){ | ^ a.cc:5:14: error: expected primary-expression before ']' token 5 | void trace(a[],n){ | ^ a.c...
s761164253
p02255
C++
#include <iostream> #include <vector> int main(){ std::cin.tie(0); std::ios_base::sync_with_stdio(false); int n; std::cin>>n; std::vector<int> array(n); for(int i=0;i<n;i++) std::cin>>array[i]; for(int i=1;i<n;i++){ std::for_each( array.begin(), array.end(), [](int const & v) { std::cout <<" "...
a.cc: In function 'int main()': a.cc:20:22: error: 'for_each' is not a member of 'std' 20 | std::for_each( array.begin(), array.end(), | ^~~~~~~~ a.cc:36:14: error: 'for_each' is not a member of 'std' 36 | std::for_each( array.begin(), array.end(), | ...
s944829652
p02255
C++
#include <iostream> using namespace std; static const int MAX = 100; void trace(int A[], int N) { for (int i = 0; i < N; i++) { cout << A[i]; if (i < N-1) cout << " "; } cout << "" << endl; } insertionSort(int A[], int N) { int v, j; for(int i = 0; i < N; i++) { v = A[i]; j = i - 1; while(j >= 0 &&...
a.cc:15:1: error: ISO C++ forbids declaration of 'insertionSort' with no type [-fpermissive] 15 | insertionSort(int A[], int N) | ^~~~~~~~~~~~~ a.cc: In function 'int insertionSort(int*, int)': a.cc:28:1: warning: no return statement in function returning non-void [-Wreturn-type] 28 | } | ^
s472220893
p02255
C++
#include<stdio.h> int main(){ int *A; int N = 0; scanf("%d", &N); A = new int[N]; for( int i = 0; i < N; i++ ){ scanf("%d", &A[i]); } for( int i = 0; i < N; i++ ){ int temp = A[i]; for( int j = i - 1; j >= 0; j-- ){ if( temp < A[j] ){ A[j+1] = A[j]; } } A[j] = temp; Output(A, N); } re...
a.cc: In function 'int main()': a.cc:20:19: error: 'j' was not declared in this scope 20 | A[j] = temp; | ^ a.cc:21:17: error: 'Output' was not declared in this scope 21 | Output(A, N); | ^~~~~~
s587245675
p02255
C++
#include<stdio.h> void insertionSort(int,int); int main() { int A[101],N; scanf("%d",&N); scanf("%d",&A); insertionSort(A,N); // insertionSort(A, N) // N??????????´??????????0-?????????????????????A // for i ??? 1 ?????? N-1 ?????§ // v = A[i] // j = i - 1 // while j >= 0 ?????? A[j] >...
a.cc: In function 'int main()': a.cc:10:19: error: invalid conversion from 'int*' to 'int' [-fpermissive] 10 | insertionSort(A,N); | ^ | | | int* a.cc:3:20: note: initializing argument 1 of 'void insertionSort(int, int)' 3 | void inser...
s008786207
p02255
C++
#include<stdio.h> void insertionSort(int*,int); int main() { int A[101],N; scanf("%d",&N); scanf("%d",&A); insertionSort(A,N); // insertionSort(A, N) // N??????????´??????????0-?????????????????????A // for i ??? 1 ?????? N-1 ?????§ // v = A[i] // j = i - 1 // while j >= 0 ?????? A[j] ...
a.cc: In function 'int main()': a.cc:23:1: error: a function-definition is not allowed here before '{' token 23 | { | ^ a.cc:37:2: error: expected '}' at end of input 37 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s370367954
p02255
C++
#include<stdio.h> void insertionSort(int*,int); int main() { int A[100],N,n; scanf("%d",&N); for(n=0;n<=N;n++) scanf("%d",&A[n]); insertionSort(A,N); return 0; } void insertionSort(int* a,int n) { int i,j,k; for(i=0;i<=n-2;i++) { k=a[i]; j=i+1; while(j>=1) { ...
a.cc: In function 'void insertionSort(int*, int)': a.cc:29:1: error: expected primary-expression before '?' token 29 | ????????? j--; | ^ a.cc:29:2: error: expected primary-expression before '?' token 29 | ????????? j--; | ^ a.cc:29:3: error: expected primary-expression before '?' token 29 | ?...
s041696189
p02255
C++
#include<stdio.h> #include<stdio.h> void insertionSort(int*, int); int main() { int A[100], N, n; scanf_s("%d", &N); for (n = 0; n <= N; n++) scanf_s("%d", &A[n]); insertionSort(A, N); return 0; } void insertionSort(int*a, int n) { int x; for (x = 0; x <= n - 2; x++) printf("%d ", a[x]); printf("%d\n"...
a.cc: In function 'int main()': a.cc:11:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 11 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s747738208
p02255
C++
#include<stdio.h> void insertionSort(int*, int); int main() { int A[101], N, n; scanf_s("%d", &N); for (n = 0; n <= N - 1; n++) scanf_s("%d", &A[n]); insertionSort(A, N); return 0; } void insertionSort(int*a, int n) { int x; for (x = 0; x <= n - 2; x++) printf("%d ", a[x]); printf("%d\n", a[n - 1]); int i,...
a.cc: In function 'int main()': a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 7 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s350416624
p02255
C++
h#include<stdio.h> void insertionSort(int*, int); int main() { int A[101], N, n; scanf("%d", &N); for (n = 0; n <= N - 1; n++) scanf("%d", &A[n]); insertionSort(A, N); return 0; } void insertionSort(int*a, int n) { int x; for (x = 0; x <= n - 2; x++) printf("%d ", a[x]); printf("%d\n", a[n - 1]); int i, j,...
a.cc:1:2: error: stray '#' in program 1 | h#include<stdio.h> | ^ a.cc:1:1: error: 'h' does not name a type 1 | h#include<stdio.h> | ^ a.cc: In function 'int main()': a.cc:7:9: error: 'scanf' was not declared in this scope 7 | scanf("%d", &N); | ^~~~~ a.cc:9:9: error: 'inse...
s632634014
p02255
C++
#include<stdio.h> void insertionSort(int*, int); int main() { int A[101], N, n; scanf_s("%d", &N); for (n = 0; n <= N - 1; n++) scanf_s("%d", &A[n]); insertionSort(A, N); return 0; } void insertionSort(int*a, int n) { int x; for (x = 0; x <= n - 2; x++) printf("%d ", a[x]); printf("%d\n", a[n - 1]); int i,...
a.cc: In function 'int main()': a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 7 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s889288517
p02255
C++
input1 = N; input2 = A[N]; for i = 1 to A.length-1 key = A[i] /* insert A[i] into the sorted sequence A[0,...,j-1] */ j = i - 1 while j >= 0 and A[j] > key A[j+1] = A[j] j-- A[j+1] = key print "A[N]";
a.cc:1:1: error: 'input1' does not name a type 1 | input1 = N; | ^~~~~~ a.cc:2:1: error: 'input2' does not name a type 2 | input2 = A[N]; | ^~~~~~ a.cc:4:1: error: expected unqualified-id before 'for' 4 | for i = 1 to A.length-1 | ^~~
s307757638
p02255
C++
#include<iostream> using namespace std; int main(){ int N; cin >> N; int a[N]; for(int i = 0; i < N; i++) cin >> a[i]; for(int i = 1; i < N; i++){ int v = a[i], int j = i - 1; while(j >= 0 && a[j] > v){ a[j + 1] = a[j]; j--; } a[j + 1] = v; for(int j = 0; j < N; j++) cout << a[i] << " "; c...
a.cc: In function 'int main()': a.cc:12:31: error: expected unqualified-id before 'int' 12 | int v = a[i], int j = i - 1; | ^~~ a.cc:13:23: error: 'j' was not declared in this scope 13 | while(j >= 0 && a[j] > v){ | ^ ...
s953250799
p02255
C++
#include <stdio.h> int main() { int N; int A[1000] = { 0 }; int i, j; int v=0; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d", &A[i]); } for (i = 1; i < N; i++) { v = A[i]; j = i - 1; while (j >= 0 && A[j]>v) { v = A[j + 1]; A[j + 1] = A[j]; A[j] = v; j--; } } for (i = 1; ...
a.cc: In function 'int main()': a.cc:29:25: error: 'n' was not declared in this scope 29 | for (i = 1; i < n; i++) | ^
s263554438
p02255
C++
#include <stdio.h> int main(){ int *A,N=0; scanf("%d", N); for(int i=0;i<N;i++){ scanf("%d", A[i]); } for(int i=0;i<N;i++){ int v; v = A[i]; int j = i - 1; while( j >= 0 && A[j] > v){ A[j+1] = A[j]; j--; A[j+1] = v; for(int i=0;i<N-1;i++){ printf("%d ", A[i]); } printf("%d\n", A[N-1]); } ...
a.cc: In function 'int main()': a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:9:22: note: to match this '{' 9 | for(int i=0;i<N;i++){ | ^ a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ ...
s414310592
p02255
C++
int main(){ int *A,N=0; scanf("%d", N); for(int i=0;i<N;i++){ scanf("%d", A[i]); } for(int i=0;i<N;i++){ int v; v = A[i]; int j = i - 1; while( j >= 0 && A[j] > v){ A[j+1] = A[j]; j--; A[j+1] = v; } for(int i=0;i<N-1;i++){ printf("%d ", A[i]); } printf("%d\n", A[N-1]); } }
a.cc: In function 'int main()': a.cc:3:2: error: 'scanf' was not declared in this scope 3 | scanf("%d", N); | ^~~~~ a.cc:17:4: error: 'printf' was not declared in this scope 17 | printf("%d ", A[i]); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable b...
s182662923
p02255
C++
#include <stdio.h> int main(){ int Num = 0; scanf_s("%d", &Num); int* Elem = new int[Num]; for (int i = 0; i < Num; ++i){ scanf_s("%d", &Elem[i]); } int v = 0, j = 0; for (int i = 1; i < Num; ++i){ printf_s("%d", Elem[0]);//出力 for (int c = 1; c < Num; ++c){ printf_s(" %d", Elem[c]); } printf_s("...
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d", &Num); | ^~~~~~~ | scanf a.cc:15:17: error: 'printf_s' was not declared in this scope; did you mean 'printf'? 15 | printf_s("%d", ...
s386954695
p02255
C++
import java.util.Scanner; public class Main { public static void main(String args[]){ int n=100; int i,j,k,v,l; int a[]=new int[n+1]; Scanner sc = new Scanner(System.in); k=Integer.parseInt(sc.next()); for(i=0;i<k;i++){ a[i]=Integer.parseInt(sc.next()); } for(i=0;i<k;i++){ System.out.print...
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:1: error: expected unqualified-id before 'public' 4 | public class Main { | ^~~~~~
s325238174
p02255
C++
#include <iostream > int main (void) { int a[100]; int a_length; std::cin >> a_length ; for ( int i = 0 ; i < a_length; a++) std::cin >> a[i]; int key; int j; for ( int i = 0; i < a_length; a++) { key = a[i]; j = i -1; while ( j >= 0 && a[j] > key) { a[j+1] = a[j]; j-- ...
a.cc:1:10: fatal error: iostream : No such file or directory 1 | #include <iostream > | ^~~~~~~~~~~ compilation terminated.
s004351648
p02255
C++
#include <iostream> int main (void) { int a[100]; int a_length; std::cin >> a_length ; for ( int i = 0 ; i < a_length; a++) std::cin >> a[i]; int key; int j; for ( int i = 0; i < a_length; a++) { key = a[i]; j = i -1; while ( j >= 0 && a[j] > key) { a[j+1] = a[j]; j-- ...
a.cc: In function 'int main()': a.cc:8:35: error: lvalue required as increment operand 8 | for ( int i = 0 ; i < a_length; a++) | ^ a.cc:14:34: error: lvalue required as increment operand 14 | for ( int i = 0; i < a_length; a++) { | ...
s808986362
p02255
C++
#include <iostream> #include <algorithm> void show(const int a[], const int N){ for(int i =0; i<N;++i){ std::cout << (i==0 ? "" : " ") << a[i]; } std::cout << std::endl; } int main(){ int N; int a[100]; std::cin >> N; for (int i=0;i<N;++i){ std::cin >> a[i]; } for (int i=1; i<N; ++i){ ...
a.cc: In function 'int main()': a.cc:22:5: error: 'j' was not declared in this scope 22 | j = i -1; | ^
s647382242
p02255
C++
#include <iostream> #include <algorithm> void show(const int a[], const int N){ for(int i =0; i<N;++i){ std::cout << (i==0 ? "" : " ") << a[i]; } std::cout << std::endl; } int main(){ int N; int a[100]; std::cin >> N; for (int i=0;i<N;++i){ std::cin >> a[i]; } for (int i=1; i<N; ++i){ ...
a.cc: In function 'int main()': a.cc:22:5: error: 'j' was not declared in this scope 22 | j = i -1; | ^
s108669513
p02255
C++
#include <iostream> using namespace std; int a[100]; int N; void print() { cout << a[0]; for (int i = 1; i < N; i++) { cout << " " << a[i]; } cout << endl; } void insertionSort() { print(); for (int i = 1; i < N; i++) { int key = a[i]; for (int j = i-1; j>=0; j--) { ...
a.cc: In function 'void insertionSort()': a.cc:26:11: error: 'j' was not declared in this scope 26 | a[j+1] = key; | ^
s094494041
p02255
C++
#include <iostream> using namespace std; int a[100]; int N; void print() { cout << a[0]; for (int i = 1; i < N; i++) { cout << " " << a[i]; } cout << endl; } void insertionSort() { print(); for (int i = 1; i < N; i++) { int key = a[i]; int j = i-1 for (; j...
a.cc: In function 'void insertionSort()': a.cc:21:9: error: expected ',' or ';' before 'for' 21 | for (; j>=0; j--) { | ^~~ a.cc:21:25: error: expected ';' before ')' token 21 | for (; j>=0; j--) { | ^ | ;
s522233830
p02255
C++
#include <iostream> using namespace std; int InSort(int N, int A[]){ for(int i = 1; i < N; i++){ int v = A[i]; j = i-1; while(j >= 0&& A[j] > v){ A[j+1] = A[j]; j--; } A[j+1] = v; for(i = 0; i < N; i++){ cout << A[i]; } } } int main(){ int N, A[]; cin >> N; ...
a.cc: In function 'int InSort(int, int*)': a.cc:7:5: error: 'j' was not declared in this scope 7 | j = i-1; | ^ a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type] 19 | } | ^ a.cc: In function 'int main()': a.cc:22:10: error: storage size of 'A' isn't known ...
s425195266
p02255
C++
#include <iostream> using namespace std; int InSort(int N, int A[]){ for(int i = 1; i < N; i++){ int v = A[i]; int j = i-1; while(j >= 0&& A[j] > v){ A[j+1] = A[j]; j--; } A[j+1] = v; for(int i = 0; i < N; i++){ cout << A[i]; } } } int main(){ int N, A[]; cin...
a.cc: In function 'int InSort(int, int*)': a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type] 19 | } | ^ a.cc: In function 'int main()': a.cc:22:10: error: storage size of 'A' isn't known 22 | int N, A[]; | ^
s931414613
p02255
C++
using namespace std; static const int MAX = 100; void trace(int N, int A[]){ for(i = 1; i < N; i++){ cout << A[i] << " "; } cout << \n; } int InSort(int N, int A[]){ int j,v,i; for(i = 1; i < N; i++){ v = A[i]; j = i-1; while(j >= 0&& A[j] > v){ A[j+1] = A[j]; j--; } A[j...
a.cc:8:11: error: stray '\' in program 8 | cout << \n; | ^ a.cc: In function 'void trace(int, int*)': a.cc:5:7: error: 'i' was not declared in this scope 5 | for(i = 1; i < N; i++){ | ^ a.cc:6:5: error: 'cout' was not declared in this scope 6 | cout << A[i] << " "; ...
s040796063
p02255
C++
#include <iostream> using namespace std; static const int MAX = 100; void trace(int N, int A[]){ for(int i = 1; i < N; i++){ cout << A[i] << " "; } cout << \n; } int InSort(int N, int A[]){ int j,v,i; for(i = 1; i < N; i++){ v = A[i]; j = i-1; while(j >= 0&& A[j] > v){ A[j+1] = A[j]; ...
a.cc:9:11: error: stray '\' in program 9 | cout << \n; | ^ a.cc: In function 'void trace(int, int*)': a.cc:9:12: error: 'n' was not declared in this scope 9 | cout << \n; | ^ a.cc: In function 'int InSort(int, int*)': a.cc:25:1: warning: no return statement in function retur...
s311538402
p02255
C++
} void InSort(int N, int A[]){ int j,v,i; for(i = 1; i < N; i++){ v = A[i]; j = i-1; while(j >= 0&& A[j] > v){ A[j+1] = A[j]; j--; } A[j+1] = v; } trace(N, A); } int main(){ int N, i, j; int A[100]; cin >> N; for(int i = 0; i < N; i++) { cin >> A[i]; } InSort(...
a.cc:1:1: error: expected declaration before '}' token 1 | } | ^ a.cc: In function 'void InSort(int, int*)': a.cc:15:3: error: 'trace' was not declared in this scope 15 | trace(N, A); | ^~~~~ a.cc: In function 'int main()': a.cc:22:3: error: 'cin' was not declared in this scope 22 | cin >> N...
s506174950
p02255
C++
#include <stdio.h> void trace(int A[], int N){ int i; for( i = 0; i < N; i++){ if(i > 0) printf(" "); printf("%d", A[i]); } printf("\n"); } void InSort(intA[], N){ int j, i, v; for(i = 1; i < N; i++){ v = A[i]; j = i-1; while (j>=0&& A[j] >v) { A[j+1] = A[j]; j--; } ...
a.cc:12:6: error: variable or field 'InSort' declared void 12 | void InSort(intA[], N){ | ^~~~~~ a.cc:12:13: error: 'intA' was not declared in this scope; did you mean 'int'? 12 | void InSort(intA[], N){ | ^~~~ | int a.cc:12:18: error: expected primary-expression bef...
s118818757
p02255
C++
include<stdio.h> int main(void) { int i,j,v,n; int array[100]; scanf("%d\n", &n); for(i=0; i<n; i++) { scanf("%d", &array[i]); } for(i=0; i<n; i++) { printf("%d", array[i]); if(i!=n-1) printf(" "); else printf("\n"); } for(i=1; i<n; i++) { v = array[i]; j = ...
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~ a.cc:43:2: error: expected class-name at end of input 43 | ~ | ^
s291468504
p02255
C++
import sys lines = sys.stdin.readlines() N = lines[0] A = lines[1].strip().split(" ") print " ".join(A) for i in range(1, len(A)): key = A[i] j = i - 1 while j >= 0 and A[j] > key: A[j+1] = A[j] j -= 1 A[j+1] = key print " ".join(A)
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s399626878
p02255
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n; cin >> n; int * a = new int[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 1; i < n; i++) { int key = a[i]; int j = i - 1; while (j > 0 && key < a[j]) { a[j+1] = a[j]; j--...
a.cc: In function 'int main()': a.cc:26:14: error: expected primary-expression before '<<' token 26 | if (k) << ' '; | ^~
s530841405
p02255
C++
#include <iostream> using namespace std; int main() { int n; cin>>n int A[1000] for(int i=0; i<n; i++) cin>>A[i]; for(int i=1; i<=N-1; i++){ int v = A[i]; int j = i - 1; while( j >= 0 && A[j] > v){ A[j+1] = A[j]; j-- A[j+1] = v } for(int a=0; a<n; a++) cout<<A[a]<<" "...
a.cc: In function 'int main()': a.cc:6:15: error: expected ';' before 'int' 6 | cin>>n | ^ | ; 7 | int A[1000] | ~~~ a.cc:8:22: error: 'i' was not declared in this scope 8 | for(int i=0; i<n; i++) | ...
s123312158
p02255
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n int A[1000] for(int i=0; i<n; i++) cin>>A[i]; for(int i=1; i<=N-1; i++){ int v = A[i]; int j = i - 1; while( j >= 0 && A[j] > v){ A[j+1] = A[j]; j-- A[j+1] = v } for(int a=0; a<n; a++) cout<<A[a]...
a.cc: In function 'int main()': a.cc:6:15: error: expected ';' before 'int' 6 | cin>>n | ^ | ; 7 | int A[1000] | ~~~ a.cc:8:22: error: 'i' was not declared in this scope 8 | for(int i=0; i<n; i++) | ...
s734403453
p02255
C++
using namespace std; int main() { int n; cin>>n; int A[1000]; for(int i=0; i<n; i++) cin>>A[i]; for(int i=1; i<=n-1; i++){ int v = A[i]; int j = i - 1; while( j >= 0 && A[j] > v){ A[j+1] = A[j]; j--; A[j+1] = v; } for(int a=0; a<n-1; a++) cout<<A[a]<<" "; cout<<A...
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin>>n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:18:17: er...
s187902062
p02255
C++
#include <iostream> using namespace std; void insertionSort(int A[], int N){ for(int i=1;i<N;i++){ int v=A[i]; int j = i - 1; while((j>=0)&&(A[j]>v)) {A[j+1] = A[j]; j--; A[j+1] = v;} for(int k=0;k<N;k++){ cout<<A[k]<<" ";} cout<<endl; } }
/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
s433733739
p02255
C++
n = int(input()) l = [int(x) for x in input().split()] for i in range(n): if i == 0: continue a = l[i] j = i - 1 while j >= 0 and l[j] > a: l[j+1] = l[j] j = j - 1 l[j+1] = a print(*l) # print(' '.join([str(x) for x in l]))
a.cc:18:7: error: invalid preprocessing directive #print 18 | # print(' '.join([str(x) for x in l])) | ^~~~~ a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s766374428
p02255
C++
#include <iostream> using namespace std; int main() { int j,v,n; cin>>n; int num[n]; for(int i=0;i<n;i++) { cin >> num[i]; } for(int i = 0;i < n-1;i++) { cout<<num[i]<<" "; } cout << num[n-1] << endl; } for (int i = 1; i < n; i++) { v = num[i]; j = i - 1; while(j >= 0...
a.cc:20:3: error: expected unqualified-id before 'for' 20 | for (int i = 1; i < n; i++) { | ^~~ a.cc:20:19: error: 'i' does not name a type 20 | for (int i = 1; i < n; i++) { | ^ a.cc:20:26: error: 'i' does not name a type 20 | for (int i = 1; i < n; i++) { | ...
s749661404
p02255
C++
#include <vector> #include <iostream> using namespace std; template<typename Type> void print_vector(vector<Type> A) { for (vector<Type>::size_type j = 0; j < A.size(); ++j) { if (j + 1 < A.size()) { cout << A[j] << ' '; } else { cout << A[j] << endl; } } } template<typename Type> void intersion...
a.cc: In function 'void print_vector(std::vector<Type>)': a.cc:8:14: error: need 'typename' before 'std::vector<Type>::size_type' because 'std::vector<Type>' is a dependent scope 8 | for (vector<Type>::size_type j = 0; j < A.size(); ++j) | ^~~~~~~~~~~~ a.cc:8:37: error: expected ';' befor...
s262299432
p02255
C++
#include <iostream> using namespace std; void displayA(int A[], int N){ for(int i=0; i<N-1; i++) cout << A[i] << " " cout << A[N] << endl; } void insertionSort(int A[], int N){ for(int i = 1; i < N; i++){ displayA(A, N); int v = A[i]; int j = i - 1; while(0 <= j && v < A[j]){ A[j+1] = A[j]; ...
a.cc: In function 'void displayA(int*, int)': a.cc:6:28: error: expected ';' before 'cout' 6 | cout << A[i] << " " | ^ | ; 7 | cout << A[N] << endl; | ~~~~
s053937786
p02255
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_INPUT_SIZE 1024 #define INPUT_FROM_FILE int* createArray(int size, char* input); void insertionSort(int size, int *array); int main(int argc, char* argv[]) { char input[MAX_INPUT_SIZE]; int size = atoi(fgets(input, sizeof(input), stdin)...
a.cc: In function 'int* createArray(int, char*)': a.cc:37:19: error: expected ';' before 'http' 37 | for (int i http://judge.u-aizu.ac.jp/onlinejudge/= 0; i < size; i++) { | ^~~~~ | ; a.cc:37:24: error: found ':' in nested-name-specifier, expected '::' 37 | ...
s560325464
p02255
C++
#include <iostream> #include <stdio.h> using namespace std; int main_in(){ int A[1001]; int num; for(int i=0;i<1001;i++){ A[i] = 0; } cin >>num; for(int i=0;i<num;i++){ scanf("%d",&A[i]); } void insertionSort(int* A,int N); insertionSort(A,num); re...
/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
s375690805
p02255
C++
#include <iostream> #include <stdio.h> using namespace std; int main_in(){ int A[1001]; int num; for(int i=0;i<1001;i++){ A[i] = 0; } cin >>num; for(int i=0;i<num;i++){ scanf("%d",&A[i]); } void insertionSort(int* A,int N); insertionSort(A,num); re...
/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
s174689629
p02255
C++
#include <stdio.h> void content(a, n){ for(int j = 0; j < n - 1; j++){ printf("%d ", a[j]); } printf("%d\n",a[n - 1]); return; } int main(void) { int n; scanf("%d", &n); int a[n]; for(int i = 0; i < n; i++){ scanf("%d", &a[i]); } content(a, n); for(int i = 1; i < n; i++){ int v = a[i]; int j = i- 1...
a.cc:3:6: error: variable or field 'content' declared void 3 | void content(a, n){ | ^~~~~~~ a.cc:3:14: error: 'a' was not declared in this scope 3 | void content(a, n){ | ^ a.cc:3:17: error: 'n' was not declared in this scope 3 | void content(a, n){ | ^ a...
s215304120
p02255
C++
#include <stdio.h> void content(a, n){ for(int j = 0; j < n - 1; j++){ printf("%d ", a[j]); } printf("%d\n",a[n - 1]); return; } int main(void) { int n; scanf("%d", &n); int a[n]; for(int i = 0; i < n; i++){ scanf("%d", &a[i]); } content(a, n); for(int i = 1; i < n; i++){ int v = a[i]; int j = i- 1...
a.cc:3:6: error: variable or field 'content' declared void 3 | void content(a, n){ | ^~~~~~~ a.cc:3:14: error: 'a' was not declared in this scope 3 | void content(a, n){ | ^ a.cc:3:17: error: 'n' was not declared in this scope 3 | void content(a, n){ | ^ a...
s776298474
p02255
C++
#include <stdio.h> void content(a, n){ for(int j = 0; j < n - 1; j++){ printf("%d ", a[j]); } printf("%d\n",a[n - 1]); // return; } int main(void) { int n; scanf("%d", &n); int a[n]; for(int i = 0; i < n; i++){ scanf("%d", &a[i]); } content(a, n); for(int i = 1; i < n; i++){ int v = a[i]; int j = i-...
a.cc:3:6: error: variable or field 'content' declared void 3 | void content(a, n){ | ^~~~~~~ a.cc:3:14: error: 'a' was not declared in this scope 3 | void content(a, n){ | ^ a.cc:3:17: error: 'n' was not declared in this scope 3 | void content(a, n){ | ^ a...
s772381619
p02255
C++
#include <stdio.h> int content(a, n){ for(int j = 0; j < n - 1; j++){ printf("%d ", a[j]); } printf("%d\n",a[n - 1]); return 0; } int main(void) { int n; scanf("%d", &n); int a[n]; for(int i = 0; i < n; i++){ scanf("%d", &a[i]); } content(a, n); for(int i = 1; i < n; i++){ int v = a[i]; int j = i- ...
a.cc:3:13: error: 'a' was not declared in this scope 3 | int content(a, n){ | ^ a.cc:3:16: error: 'n' was not declared in this scope 3 | int content(a, n){ | ^ a.cc:3:17: error: expression list treated as compound expression in initializer [-fpermissive] 3 | int conten...
s352352019
p02255
C++
#include <iostream> #include <algorithm> using namespace std; static const int N = 1000; #define rep(i,a) for(int i = 0 ; i < a ; i ++) #define loop(i,a,b) for(int i = a ; i < b ; i ++) int main(void){ int n,a[N]; cin>>n; rep(i,n)cin>>a[i]; rep(i,n){ int v = a[i]; for(int j = i-1 ; j >= 0 && a[j] > v; j --)...
a.cc: In function 'int main()': a.cc:19:58: error: 'j' was not declared in this scope 19 | rep(j,n)cout<<a[j]<<(j==n-1?'\n':' ');if(j!=n-1)cout<<endl; | ^
s909287231
p02255
C++
#include <stdio.h> /* ?????????????´??????????????????? */ void trace(int A[], int N) { int i; for ( i = 0; i < N, i++ ) { if ( i > 0) printf(" "); /* ??£??\??????????´?????????????????????????????????? */ printf("%d", A[i]); } printf("\n"); } /* ?????\????????? (0??????????????????) */ void insertio...
a.cc: In function 'void trace(int*, int)': a.cc:6:26: error: expected ';' before ')' token 6 | for ( i = 0; i < N, i++ ) { | ^~ | ; a.cc: At global scope: a.cc:14:26: error: expected ',' or '...' before 'A' 14 | void insertionSort(int[] A, int N) { ...
s742315432
p02255
C++
#include <stdio.h> /* ?????????????´??????????????????? */ void trace(int A[], int N) { int i; for ( i = 0; i < N; i++ ) { if ( i > 0) printf(" "); /* ??£??\??????????´?????????????????????????????????? */ printf("%d", A[i]); } printf("\n"); } /* ?????\????????? (0??????????????????) */ void insertio...
a.cc:14:26: error: expected ',' or '...' before 'A' 14 | void insertionSort(int[] A, int N) { | ^ a.cc: In function 'void insertionSort(int*)': a.cc:16:20: error: 'N' was not declared in this scope 16 | for ( i = 1; i < N; i++) { | ^ a.cc:17:9: error: 'A' ...
s346972155
p02255
C++
#include <vector>?¬ 3 #include <string>?¬ 4 ?¬ 5 int main() {?¬ 6 int N;?¬ 7 std::cin >> N;?¬ 8 ?¬ 9 std::vector<int> data(N);?¬ 10 for(int i = 0; i < N; ++i) {?¬ 11 std::cin >> data[i];?¬ 12 }?¬ 13 ?¬ 14 std::cout << "test" << std::endl;?¬ 15 ?¬ 16 for(int i = 0; i < data.size...
a.cc:1:18: warning: extra tokens at end of #include directive 1 | #include <vector>?¬ | ^ a.cc:1:19: error: extended character ¬ is not valid in an identifier 1 | #include <vector>?¬ | ^ a.cc:2:5: error: stray '#' in program 2 | 3 #include <string>?¬ | ...
s607394087
p02255
C++
#include <iostream> #include <algorithm> using namespace std; void trace(int A[], int N){ int i; for(i = 0; i < N; i++){ if(i > 0) cout << " " << endl; cout << A[i]; } } void insertionSort(int A[], int N){ for(int i = 1; i < N-1; i++){ int v = A[i]; int j = i - 1; ...
a.cc: In function 'int main()': a.cc:38:14: error: 'N' was not declared in this scope 38 | trace(A, N) | ^
s658686971
p02255
C++
#include<iostream> using namespace std; int main() { int N; cin >> N; int* arr = new int[N]; for (int i = 0; i < N; i++) cin >> arr[i]; for (int i = 0; i < N; i++) cout << arr[i] << ' ' << flush;//????§???´???????????? cout << endl; int comp; int j; for (int i = 1; i < N; i++) { comp = arr[i]; for (...
a.cc: In function 'int main()': a.cc:34:2: error: expected '}' at end of input 34 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s208035501
p02255
C++
include<iostream> using namespace std; void trace(int arr[], int N) { for(int i=0; i<N; i++){ if(i>0) cout<<' '<<flush; cout<<arr[i]<<flush; } cout<<endl; } int main() { int N; cin>>N; int* arr=new int[N]; int comp; int j; for(int i=0; i<N; i++){ cin>>arr[i]...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'void trace(int*, int)': a.cc:7:17: error: 'cout' was not declared in this scope 7 | if(i>0) cout<<' '<<flush; | ^~~~ a.cc:7:28: error: 'flush' was not declared in this scope ...
s343254520
p02255
C++
using namespace std; void insertionSort(int A[], int N); int main() { int N; cin >> N; int A[N]; for (int i = 0; i < N; i++) cin >> A[i]; insertionSort(A, N); return 0; } void insertionSort(int A[], int N) { for (int i = 0; i < N; i++){ int v = A[i]; int j = i - 1; while (j >= 0 && A[j] > v){ A[...
a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope 8 | cin >> N; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc: In fun...
s203848357
p02255
C++
#include <iostream> #include <cstdio> void isort(int a[],int n){ for(int i = 1;i<n-1;i++){ int v = a[i]; int j = i - 1; while(j>=0||a[j]>v){ a[j+1]=a[j]; j--; } a[j]=v; } } using namespace std; int main() { int n; cin >> n; for(int i=0;i<n-1;++i) cout << a[i] << " "; ...
a.cc: In function 'int main()': a.cc:23:13: error: 'a' was not declared in this scope 23 | cout << a[i] << " "; | ^ a.cc:24:11: error: 'a' was not declared in this scope 24 | cout << a[n-1] << endl; | ^
s461892945
p02255
C++
#include <iostream> #include <cstdio> void isort(int a[],int n){ for(int i = 1;i<n-1;i++){ int v = a[i]; int j = i - 1; while(j>=0||a[j]>v){ a[j+1]=a[j]; j--; } a[j]=v; } } using namespace std; int main() { int n; cin >> n; for(int i=0;i<n-1;++i) cout << a[i] << " "; ...
a.cc: In function 'int main()': a.cc:24:13: error: 'a' was not declared in this scope 24 | cout << a[i] << " "; | ^ a.cc:25:11: error: 'a' was not declared in this scope 25 | cout << a[n-1] << endl; | ^
s375549470
p02255
C++
#include <iostream> #include <cstdio> using namespace std; void isort(int a[],int n){ for(int i = 1;i<n-1;i++){ int v = a[i]; int j = i - 1; while(j>=0||a[j]>v){ a[j+1]=a[j]; j--; } a[j]=v; } } int main() { int n; cin >> n; for(int i=0;i<n-1;++i) cout << a[i] << " "; ...
a.cc: In function 'int main()': a.cc:23:13: error: 'a' was not declared in this scope 23 | cout << a[i] << " "; | ^ a.cc:24:11: error: 'a' was not declared in this scope 24 | cout << a[n-1] << endl; | ^
s027934149
p02255
C++
#include <iostream> #include <cstdio> using namespace std; void isort(int a[],int n){ for(int i = 1;i<n;i++){ int v = a[i]; int j = i - 1; while(j>=0||a[j]>v){ a[j+1]=a[j]; j--; } a[j+1]=v; } } int main() { int n; cin >> n; for(int i=0;i<n;++i) cin >> a[i]; for(int...
a.cc: In function 'int main()': a.cc:24:12: error: 'a' was not declared in this scope 24 | cin >> a[i]; | ^ a.cc:27:13: error: 'a' was not declared in this scope 27 | cout << a[i]; | ^ a.cc:37:2: error: expected '}' at end of input 37 | } | ^ a.cc:18:12: note: ...
s440787798
p02255
C++
#include <iostream> #include <cstdio> using namespace std; void isort(int a[],int n){ for(int i = 1;i<n;i++){ int v = a[i]; int j = i - 1; while(j>=0||a[j]>v){ a[j+1]=a[j]; j--; } a[j+1]=v; } } int main() { int n; cin >> n; for(int i=0;i<n;++i) cin >> a[i]; for(int...
a.cc: In function 'int main()': a.cc:24:12: error: 'a' was not declared in this scope 24 | cin >> a[i]; | ^ a.cc:27:13: error: 'a' was not declared in this scope 27 | cout << a[i]; | ^ a.cc:37:2: error: expected '}' at end of input 37 | } | ^ a.cc:18:12: note: ...
s620628821
p02255
C++
#include <iostream> #include <cstdio> using namespace std; void trace(int a[],int n){ for(int i=0;i<n;++i){ if(i>0) cout << " "; cout << a[i]; } } void isort(int a[],int n){ for(int i = 1;i<n;i++){ int v = a[i]; int j = i - 1; while(j>=0||a[j]>v){ a[j+1]=a[j]; j--; } a[j...
a.cc:40:1: error: expected declaration before '}' token 40 | } | ^
s463081025
p02255
C++
using namespace std; void output(int ar[], int sz){ for (int i = 0; i < sz; i++) { cout << ar[i]; } cout << endl; } int main(int argc, char const* argv[]) { int sz, ar[100]; cin >> sz; for (int i = 0; i < sz; i++) { cin >> ar[i]; } for (int i = 1; i < sz; i++) { ...
a.cc: In function 'void output(int*, int)': a.cc:6:9: error: 'cout' was not declared in this scope 6 | cout << ar[i]; | ^~~~ a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:8:5: er...
s825944446
p02255
C++
#include<iostream> using namespace std; const int MAX = 100; void insertionSort(int A[], int N); void showArray(int A[], int N); int main() { int A[MAX], n; cin >> n; for ( int i = 0; i < n; i++ ) cin >> A[i]; trace(A, n); insertionSort(A, n); return 0; } void insertionSort(int A[], int N) { for ...
a.cc: In function 'int main()': a.cc:15:3: error: 'trace' was not declared in this scope 15 | trace(A, n); | ^~~~~
s686426399
p02255
C++
include <iostream> using namespace std; #include <stdio.h> void insertionSort(int*, int); void print(int*, int); int main(void) { int a[100], n,i; cin >> n; for (i = 0; i < n; i++){ cin >> a[i]; } insertionSort(a, n); } void insertionSort(int *A, int N) // N??????????´??????????0-?????????????????????A { int i, v,...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:9:9: error: 'cin' was not declared in this scope 9 | cin >> n; | ^~~
s520674199
p02255
C++
#include<iostream> using namespace std; void show(int arr[], int N){ for(int i=0; i<N; i++) cout<<arr[i]<<' '<<flush; cout<<endl; } void swap(int& a, int& b){ int t=a; a=b; b=t; } int InsertSort(int[], int); int main() { int N; cin>>N; int arr[100]; for(int i=0; i<N; ...
a.cc: In function 'int InsertSort(int*, int)': a.cc:52:91: error: expected primary-expression before '?' token 52 | 1,1 ?????? | ^ a.cc:...
s153795073
p02255
C++
int insertsort(int arr[], int n) { int counter=0; int compindex; int comp; int j; for( int i=1; i < n; i++ ){ compindex=i; comp=arr[compindex]; j=1; for( ; compindex-j > -1; j++ ) { if(comp < arr[compindex-j]) arr[compindex - j + 1] = ar...
a.cc: In function 'int insertsort(int*, int)': a.cc:24:19: error: 'N' was not declared in this scope 24 | show(arr, N); | ^ a.cc:24:9: error: 'show' was not declared in this scope 24 | show(arr, N); | ^~~~
s234553666
p02255
C++
#include<iostream> using namespace std; void show(int arr[], int n){ for(int i=0; i<n; i++) cout<<arr[i]<<' '<<flush; cout<<endl; } void swap(int& a, int& b){ int t=a; a=b; b=t; } int insertsort(int[], int); int main() { int n; cin>>n; int arr[100]; for(int i=0; i<n; ...
a.cc: In function 'int insertsort(int*, int)': a.cc:73:19: error: 'N' was not declared in this scope 73 | show(arr, N); | ^
s354090078
p02255
C++
#include<iostream> using namespace std; void show(int arr[], int n){ for(int i=0; i<n; i++) cout<<arr[i]<<' '<<flush; cout<<endl; } void swap(int& a, int& b){ int t=a; a=b; b=t; } int insertsort(int[], int); int main() { int n; cin>>n; int arr[100]; for(int i=0; i<n; ...
/usr/bin/ld: /tmp/ccjpSHpz.o: in function `main': a.cc:(.text+0x133): undefined reference to `insertsort(int*, int)' collect2: error: ld returned 1 exit status