submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s544308222
p02259
C
#include<stdio.h> int main(void){ int A[100]; int N,i,v; int cunt=0; int cunt2=0;; scanf("%d",&N); for(i=0;i<N;i++)scanf("%d",&A[i]); while(1){ for(i=N;i>0;i--){ if(A[i-1]>A[i]){ v=A[i-1]; A[i-1]=A[i]; A[i]=v; cunt++; } } if(cunt2==cunt){ break; }else cunt2=cunt; } for(...
main.c: In function 'main': main.c:30:16: warning: missing terminating " character 30 | printf(" %d\",cunt); | ^ main.c:30:16: error: missing terminating " character 30 | printf(" %d\",cunt); | ^~~~~~~~~~~~~ main.c:31:9: error: expected expression before '...
s216052074
p02259
C
#inclide<stdio.h> int main(void) { int i, j, temp; scanf("5d) for (i = 0; i < (array_size - 1); i++) { for (j = (array_size - 1); j > i; j--) { if (numbers[j-1] > numbers[j]) { temp = numbers[j-1]; numbers[j-1] = numbers[j]; numbers[j] = temp; printf("%d" ,temp); } } } retur...
main.c:1:2: error: invalid preprocessing directive #inclide; did you mean #include? 1 | #inclide<stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:5:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("5d) | ^~~~~ main.c:1:1: note: inc...
s481466834
p02259
C
#include<stdio.h> int main(void){ int A[100]; int N,i,v; int cunt=0; int cunt2=0; scanf("%d",&N); for(i=0;i<N;i++)scanf("%d",&A[i]); for(j=0;j<N;j++){ for(i=N-1;i>j+1;i--){ if(A[i-1]>A[i]){ v=A[i-1]; A[i-1]=A[i]; A[i]=v; cunt++; } } } for(i=0;i<N;i++){ if(i>0)printf(" "); prin...
main.c: In function 'main': main.c:11:13: error: 'j' undeclared (first use in this function) 11 | for(j=0;j<N;j++){ | ^ main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in main.c:25:16: warning: missing terminating " character 25 | ...
s438420358
p02259
C
#include <stdio.h> int main(void){ int a[100]; int N,i,j,swap,awi = 0;,flag = 1; scanf("%d", &N); for(i=0; i<N; i++){ scanf("%d",a[i]); } i = 0; while(flag){ flag = 0; for(j=N-1; j > i+1; j--){ if( a[j] < a[j-1] ){ swap = a[j]; a[j] = a[j-1]; a[j-1] = swap; awi++; } flag...
main.c: In function 'main': main.c:4:32: error: expected expression before ',' token 4 | int N,i,j,swap,awi = 0;,flag = 1; | ^ main.c:4:33: error: 'flag' undeclared (first use in this function) 4 | int N,i,j,swap,awi = 0;,flag = 1; | ...
s657468113
p02259
C
#include <stdio.h> int main() { int a[1000],n,i,j,d=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]) for (i = 0,i<n;i++) for (j = n-1;j>= i+1;j--) if A[j] < A[j-1] { swap A[j] and A[j-1] d++; } for(i=0;i<n;i++) { printf("%d",a[i]); } printf("%d\n",d); }
main.c: In function 'main': main.c:8:20: error: expected ';' before 'for' 8 | scanf("%d",&a[i]) | ^ | ; 9 | for (i = 0,i<n;i++) | ~~~
s930130925
p02259
C
#include <stdio.h> int main() { int a[1000],n,i,j,d=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]) for (i = 0,i<n;i++) { for (j = n-1;j>= i+1;j--) { if A[j] < A[j-1] { swap A[j] and A[j-1] d++; } } } for(i=0;i<n;i++) { printf("%d",a[i]); } pri...
main.c: In function 'main': main.c:8:20: error: expected ';' before 'for' 8 | scanf("%d",&a[i]) | ^ | ; 9 | for (i = 0,i<n;i++) | ~~~
s078143322
p02259
C
#include <stdio.h> int main() { int a[1000],n,i,j,d=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); for (i = 0,i<n;i++) { for (j = n-1;j>= i+1;j--) { if A[j] < A[j-1] { swap A[j] and A[j-1] d++; } } } for(i=0;i<n;i++) { printf("%d",a[i]); } p...
main.c: In function 'main': main.c:9:20: error: expected ';' before ')' token 9 | for (i = 0,i<n;i++) | ^ | ; main.c:12:12: error: expected '(' before 'A' 12 | if A[j] < A[j-1] | ^ | ( main.c:12:12: error: 'A' undeclared...
s551241302
p02259
C
#include <stdio.h> void hoanvi(int x,int y) { int temp=x; x=y; y=temp; } int main() { int a[1000],n,i,j,d=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); for (i = 0,i<n;i++) { for (j = n-1;j>= i+1;j--) { if (a[j] < a[j-1]) { hoanvi(a[j],a[j-1]); d++; ...
main.c: In function 'main': main.c:15:20: error: expected ';' before ')' token 15 | for (i = 0,i<n;i++) | ^ | ;
s949959698
p02259
C
#include <stdio.h> void hoanvi(int & x,int & y) { int temp=x; x=y; y=temp; } int main() { int a[1000],n,i,j,d=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); for (i = 0;i<n;i++) { for (j = n-1;j>= i+1;j--) { if (a[j] < a[j-1]) { hoanvi(a[j-1],a[j]); d++...
main.c:3:17: error: expected ';', ',' or ')' before '&' token 3 | void hoanvi(int & x,int & y) | ^ main.c: In function 'main': main.c:21:11: error: implicit declaration of function 'hoanvi' [-Wimplicit-function-declaration] 21 | hoanvi(a[j-1],a[j]); | ^~~~~~
s756793334
p02259
C
#include <stdio.h> void hoanvi(int &x,int &y) { int temp=x; x=y; y=temp; } int main() { int a[1000],n,i,j,d=0; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); for (i = 0;i<n-1;i++) { for (j = n-1;j>= i+1;j--) { if (a[j] < a[j-1]) { hoanvi(a[j-1],a[j]); ...
main.c:3:17: error: expected ';', ',' or ')' before '&' token 3 | void hoanvi(int &x,int &y) | ^ main.c: In function 'main': main.c:25:11: error: implicit declaration of function 'hoanvi' [-Wimplicit-function-declaration] 25 | hoanvi(a[j-1],a[j]); | ^~~~~~
s461570532
p02259
C
#include<stdio.h> int A[]; int main( void ) { int n; int count=0; scanf( "%d", &n ); int i, j; for( i=0; i<n; i++ ) { scanf( "%d", &A[i] ); } for( i=0; i<n; i++ ) { for(j=n-1;j>i;j--) { if(A[j-1] > A[j]) { int temp = A[j-1]; A[j-1] = A[j];...
main.c: In function 'main': main.c:32:15: error: 'N' undeclared (first use in this function) 32 | for(i=1;i<N;i++) printf(" %d",A[i]); | ^ main.c:32:15: note: each undeclared identifier is reported only once for each function it appears in main.c:34:19: error: 'cnt' undeclared (first use in t...
s457308824
p02259
C
nmatsuna@Ubuntu-14:~/Aizu$ mkdir ALDS1_2_A #include <stdio.h> #define NMAX 100 int bubbleSort(int *A, int n); int main(){ int j, n, A[NMAX]; int nswitch; scanf("%d",&n); for(j=0;j<n;j++) scanf("%d",A+j); nswitch=bubbleSort(A,n); printf("%d",A[0]); for(j=1;j<n;j++) printf(" %d",A[j]); printf("...
main.c:1:9: error: stray '@' in program 1 | nmatsuna@Ubuntu-14:~/Aizu$ mkdir ALDS1_2_A | ^ main.c:1:1: error: unknown type name 'nmatsuna' 1 | nmatsuna@Ubuntu-14:~/Aizu$ mkdir ALDS1_2_A | ^~~~~~~~ main.c:1:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token 1 | n...
s161077956
p02259
C
#include<stdio.h> int main(void) { int N,i,n,j,a; n=0; scanf("%d\n",&N); int array[N]; for(i=0;i<N;i++) scanf("%d ",&array[i]); for(i=0;i<N-1;i++) { for(j=N-1;j>i;j--) { if(array[j]<array[j-1]){ a=array[j-1]; array[j-1]=array[j]; array[j]=a; n++; } } for(i=0;i<N-1;i++) printf("%d ",array[i]); printf("%d\n%d\n",array[N...
main.c: In function 'main': main.c:22:1: error: expected declaration or statement at end of input 22 | printf("%d\n%d\n",array[N-1],n); | ^~~~~~ main.c:22:1: error: expected declaration or statement at end of input
s824825426
p02259
C
#include<stdio.h> int main(void) { int N,i,n,j,a; n=0; scanf("%d\n",&N); int array[N]; for(i=0;i<N;i++) scanf("%d ",&array[i]); for(i=0;i<N-1;i++) { for(j=N-1;j>i;j--) { if(array[j]<array[j-1]){ a=array[j-1]; array[j-1]=array[j]; array[j]=a; n++; } } for(i=0;i<N-1;i++) printf("%d ",array[i]); printf("%d\n%d\n",array[...
main.c: In function 'main': main.c:24:1: error: expected declaration or statement at end of input 24 | } | ^
s615357884
p02259
C
#include<stdio.h> int main(void) { int N,i,n,j,a; n=0; scanf("%d\n",&N); int array[N]; for(i=0;i<N;i++) scanf("%d ",&array[i]); for(i=0;i<N;i++) { for(j=N-1;j>i;j--) { if(array[j]<array[j-1]){ a=array[j-1]; array[j-1]=array[j]; array[j]=a; n++; } } for(i=0;i<N-1;i++) printf("%d ",array[i]); printf("%d\n%d\n",array[N-...
main.c: In function 'main': main.c:24:1: error: expected declaration or statement at end of input 24 | } | ^
s551841185
p02259
C
#include<stdio.h> int main() { int i,n,num=0,a[100],temp; scanf("%d",&n); for (i = 0; i < n; i++) scanf("%d",&a[i]); for (i =n-2; i >=0;i--) { for (j = i; j >= 0);j--){ if(a[j]>a[j+1]){ temp = a[j+1]; a[j+1] = a[j]; a[j] = temp; num++; } } } for(i = 0; i<n-1;i++) ...
main.c: In function 'main': main.c:10:9: error: 'j' undeclared (first use in this function) 10 | for (j = i; j >= 0);j--){ | ^ main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in main.c:10:22: error: expected ';' before ')' token 10 | for (j = i;...
s838314947
p02259
C
#include<stdio.h> int main() { int i,n,num=0,j,a[100],temp; scanf("%d",&n); for (i = 0; i < n; i++) scanf("%d",&a[i]); for (i =n-2; i >=0;i--) { for (j = i; j >= 0);j--){ if(a[j]>a[j+1]){ temp = a[j+1]; a[j+1] = a[j]; a[j] = temp; num++; } } } for(i = 0; i<n-1;i++...
main.c: In function 'main': main.c:10:22: error: expected ';' before ')' token 10 | for (j = i; j >= 0);j--){ | ^ | ; main.c:10:27: error: expected ';' before ')' token 10 | for (j = i; j >= 0);j--){ | ^ | ...
s370460918
p02259
C
#include <iostream> using namespace std; //使用flag的冒泡排序法 int bubbleSort(int A[],int N){ int sw=0; bool flag=1; for(int i=0;flag;i++){ flag=0; for(int j=N-1;j>=i+1;j--){ if(A[j]<A[j-1]){ //交?相?元素 swap(A[j],A[j-1]); flag=1; ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s473546819
p02259
C
#include <stdio.h> static const int N = 1000; void trace(int A[], int n){ int i; for ( i = 1; i <= n; i++ ){ if ( i > 1 ) printf(" "); printf("%d", A[i]); } printf("\n"); } int main(){ int n, i, j; int A[N+1]; bool done = 1; scanf("%d", &n); for ( i = 1; i <= n; i++ ) scanf("%d",...
main.c: In function 'main': main.c:17:5: error: unknown type name 'bool' 17 | bool done = 1; | ^~~~ main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include <stdio.h> +++ |+#include <stdbool.h> 2 | main.c:23:20: error...
s951242005
p02259
C
#include <stdio.h> static const int N = 1000; void trace(int A[], int n){ int i; for ( i = 1; i <= n; i++ ){ if ( i > 1 ) printf(" "); printf("%d", A[i]); } printf("\n"); } int main(){ int n, i, j, done; int A[N+1]; scanf("%d", &n); for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]); ...
main.c: In function 'main': main.c:23:20: error: 'size' undeclared (first use in this function); did you mean 'size_t'? 23 | for(i = 0; i < size; i++) | ^~~~ | size_t main.c:23:20: note: each undeclared identifier is reported only once for each function it appear...
s073521345
p02259
C
// bubblesort.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include "stdio.h" int main() { int N, a, A[1000],j,x,count; scanf("%d", &N); for (a = 0; a <= N - 1; a++) scanf("%d", &A[a]); int flag = 1; int i = 0; while (flag) { ...
main.c: In function 'main': main.c:25:24: error: expected ';' before '}' token 25 | count++ | ^ | ; 26 | } | ~
s190906855
p02259
C
#include "stdio.h" ?? ?? int main() { ????????int N, a, A[100],j,x,count,i; ????????scanf("%d", &N); ?? ????????for (a = 0; a <= N - 1; a++) ????????????????scanf("%d", &A[a]); ?? ??????for (i=0 ; i<N; i++){ ????????????????for (j = N - 1;?? j > 0; j--) ????????????????????????if (A[j] < A[j - 1]) { ??????????????????...
main.c:2:1: error: expected identifier or '(' before '?' token 2 | ?? | ^
s831049636
p02259
C
#include "stdio.h" ?? ?? int main() { ????????int N, a[100],j,x,count,i; ????????scanf("%d", &N); ?? ????????for (i = 0; i <= N - 1; i++) ????????????????scanf("%d", &A[i]); ?? ??????for (i=0 ; i<N; i++){ ????????????????for (j = N - 1;?? j > 0; j--) ????????????????????????if (a[j] < a[j - 1]) { ?????????????????????...
main.c:2:1: error: expected identifier or '(' before '?' token 2 | ?? | ^
s856651089
p02259
C
#include "stdio.h" ?? ?? int main() { ????????int N, a[100],j,x,count,i; ????????scanf("%d", &N); ?? ????????for (i = 0; i <= N - 1; i++) ????????????????scanf("%d", &a[i]); ?? ??????for (i=0 ; i<N; i++){ ????????????????for (j = N - 1;?? j > 0; j--) ????????????????????????if (a[j] < a[j - 1]) { ?????????????????????...
main.c:2:1: error: expected identifier or '(' before '?' token 2 | ?? | ^
s986690225
p02259
C
#include "stdio.h" ?? ??int main() { int n, a[100], j, x, count, i; scanf("%d", &n); for (i = 0; i <= n - 1; i++) scanf("%d", &a[i]); for (i = 0; i<n; i++) { for (j = n - 1; j > 0; j--) if (a[j] < a[j - 1]) { x = a[j]; a[j] = a[j - 1]; ...
main.c:2:1: error: expected identifier or '(' before '?' token 2 | ?? | ^
s680467719
p02259
C
#include<stdio.h> int main(){ int i,j,n,count = 0; scanf("%d",&n); int a[n]; for(i = 0; i < n; i++) scanf("%d",&a[i]); for(i = 0; i < n; i++){ for(j = n-1; j >= i; j--){ if(a[j] < a[j-1]){ int tmp = a[j}; a[j] = a[j-1]; a[j-1] = tmp; count++; } } } for(i = 0...
main.c: In function 'main': main.c:21:18: error: expected ']' before '}' token 21 | int tmp = a[j}; | ^ | ] main.c:21:18: error: expected ',' or ';' before '}' token main.c:39:22: error: request for member 'a' in something not a structure or union 39 | printf(...
s654480428
p02259
C
#include<stdio.h> int main(){ int i,j,n,count = 0; scanf("%d",&n); int a[n] = 100; for(i = 0; i < n; i++) scanf("%d",&a[i]); for(i = 0; i < n; i++){ for(j = n-1; j >= i; j--){ if(a[j] < a[j-1]){ int tmp = a[j]; a[j] = a[j-1]; a[j-1] = tmp; count++; } } } for...
main.c: In function 'main': main.c:9:15: error: variable-sized object may not be initialized except with an empty initializer 9 | int a[n] = 100; | ^~~
s140666730
p02259
C
#include<stdio.h> #define n 100 int main(){ int i,j,n,count = 0; scanf("%d",&n); int a[n]; for(i = 0; i < n; i++) scanf("%d",&a[i]); for(i = 0; i < n; i++){ for(j = n-1; j >= i; j--){ if(a[j] < a[j-1]){ int tmp = a[j]; a[j] = a[j-1]; a[j-1] = tmp; count++; } } }...
main.c: In function 'main': main.c:2:11: error: expected identifier or '(' before numeric constant 2 | #define n 100 | ^~~ main.c:6:12: note: in expansion of macro 'n' 6 | int i,j,n,count = 0; | ^ main.c:8:15: error: lvalue required as unary '&' operand 8 | scanf("%d",...
s612886326
p02259
C
#include<stdio.h> void bubbleSort(int A[], int N){ int i, j, k, count = 0; for( i = 0; i < N; i++ ){ for(j = i + 1 ; j < N; j++ ){ if(A[i] > A[j]){ k = A[j]; A[j] = A[i]; A[i] = k; count += 1; } } } space(A, N); printf("%d\n",count); } void space(int A[], ...
main.c: In function 'bubbleSort': main.c:15:3: error: implicit declaration of function 'space' [-Wimplicit-function-declaration] 15 | space(A, N); | ^~~~~ main.c: At top level: main.c:19:6: warning: conflicting types for 'space'; have 'void(int *, int)' 19 | void space(int A[], int N){ | ^~~~...
s644375734
p02259
C
#include<stdio.h> int main() { int N, i, j, temp, count=0; int A[100]; scanf("%d", &N); for(i=0; i<N; i++) scanf("%d", &A[i]); for(i=0; i<N-1; i++){ \*N-1?????°???????????¨????????????????????§??????*\ for(j=N-1; j>=i+1; j--){ if(A[j]<A[j-1]){ temp = A[j]; ...
main.c: In function 'main': main.c:13:28: error: stray '\' in program 13 | for(i=0; i<N-1; i++){ \*N-1?????°???????????¨????????????????????§??????*\ | ^ main.c:13:29: error: invalid type argument of unary '*' (have 'int') 13 | for(i=0; i<N-1; i++){ \*N-1?????°??????????...
s918427092
p02259
C
#include<stdio.h> int main() { int n, v; int A[150]; int i = 0, j = 0, s = 0; scanf("%d", &n); while (i < n) { scanf("%d", &A[i]); i++; } for (i = n - 1; i >= 0; --i) { for (j = i; j >= 0; --j) { if (A[i] < A[j]) { v = A[i]; A[i] = A[j]; ...
main.c: In function 'main': main.c:28:15: error: 'k' undeclared (first use in this function) 28 | if (k != n - 1) | ^ main.c:28:15: note: each undeclared identifier is reported only once for each function it appears in
s267474684
p02259
C
#include <stdio.h> void syuturyoku( int A[], int N ) { int i; for ( i = 0; i < N; i++ ) { if ( i > 0 ) { printf(" "); } printf("%d", A[i]); } printf("\n"); } void bubbleSort( int A[], int N ) { int i, j, v; int wa = 0; for ( i = 0; i < N; i++ ) { j = N - 1 - i;...
main.c: In function 'bubbleSort': main.c:45:1: error: expected declaration or statement at end of input 45 | } | ^
s638025035
p02259
C
#include <stdio.h> void syuturyoku( int A[], int N ) { int i; for ( i = 0; i < N; i++ ) { if ( i > 0 ) { printf(" "); } printf("%d", A[i]); } printf("\n"); } void bubbleSort( int A[], int N ) { int i, j, v; int wa = 0; for ( i = 0; i < N; i++ ) { j = N - 1 - i;...
main.c: In function 'bubbleSort': main.c:46:1: error: expected declaration or statement at end of input 46 | } | ^
s732737462
p02259
C
#include <stdio.h> void syuturyoku( int A[], int N ) { int i; for ( i = 0; i < N; i++ ) { if ( i > 0 ) { printf(" "); } printf("%d", A[i]); } printf("\n"); } void bubbleSort( int A[], int N ) { int i, j, v; int wa = 0; for ( i = 0; i < N; i++ ) { j = N - 1 - i;...
main.c: In function 'bubbleSort': main.c:47:1: error: expected declaration or statement at end of input 47 | } | ^
s547363018
p02259
C
#include <stdio.h> void syuturyoku( int A[], int N ) { int i; for ( i = 0; i < N; i++ ) { if ( i > 0 ) { printf(" "); } printf("%d", A[i]); } printf("\n"); } void bubbleSort( int A[], int N ) { int i, j, v; int wa = 0; for ( i = 0; i < N; i++ ) { j = N - 1 - i;...
main.c: In function 'bubbleSort': main.c:47:1: error: expected declaration or statement at end of input 47 | } | ^
s893511398
p02259
C
#include <stdio.h> void syuturyoku( int A[], int N ) { int i; for ( i = 0; i < N; i++ ) { if ( i > 0 ) { printf(" "); } printf("%d", A[i]); } printf("\n"); } void bubbleSort( int A[], int N ) { int i, j, v; int wa = 0; for ( i = 0; i < N; i++ ) { j = N - 1 - i;...
main.c: In function 'bubbleSort': main.c:47:1: error: expected declaration or statement at end of input 47 | } | ^
s011960756
p02259
C
#include<stdio.h> int main () { int n, i, flag, swap; int a[100] = {0}; int count = 0; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d",&a[i]); } flag = 1; while(flag){ flag = 0; for(i = n-1; i > 0; i--){ if(a[i] < a[j-1]){ a[j] = swap; ...
main.c: In function 'main': main.c:21:22: error: 'j' undeclared (first use in this function) 21 | if(a[i] < a[j-1]){ | ^ main.c:21:22: note: each undeclared identifier is reported only once for each function it appears in
s890404014
p02259
C
#include<stdio.h> int main(){ int i,j,n; int count = 0; int a[100] = 0; scanf("%d",&n); for(i = 0; i < n; i++){ scanf("%d",&a[i]); } for(i = 0; i < n; i++){ for(j = n-1; j >= i; j--){ if(a[j] < a[j-1]){ int tmp = a[j]; a[j] = a[j-1]; a[j-1] = tmp; count++; } }...
main.c: In function 'main': main.c:7:17: error: invalid initializer 7 | int a[100] = 0; | ^
s678212705
p02259
C
#include <stdio.h> void bubbleSort( int A[], int N ) { int i, j, v; int wa = 0; for ( i = 0; i < N; i++ ) { j = N - 1 - i; for ( k = j; k = 0; k-- ) { if ( k >= 0 && A[ k ] < A[ k - 1 ] ) { v = A[ k ]; A[ k ] = A[ k - 1 ]; A[ k - 1 ] = v; } ...
main.c: In function 'bubbleSort': main.c:10:13: error: 'k' undeclared (first use in this function) 10 | for ( k = j; k = 0; k-- ) { | ^ main.c:10:13: note: each undeclared identifier is reported only once for each function it appears in
s930628565
p02259
C
#include <stdio.h> int main(void) { int A[100], i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &A[i]); } sw = bubbleSort(A, n); for (i = 0; i < n; i++) { if (i) printf(" "); printf("%d", A[i]); } printf("\n"); printf("%d\n", sw); return 0; } int bubbleSort(int...
main.c: In function 'main': main.c:6:16: error: 'n' undeclared (first use in this function) 6 | scanf("%d", &n); | ^ main.c:6:16: note: each undeclared identifier is reported only once for each function it appears in main.c:11:3: error: 'sw' undeclared (first use in this function) 11 | s...
s891267719
p02259
C
#include<stdio.h> int bubbleSort(intA[], int N){ int i, j, temp; int sw = 0; for (i=0; flag = 1; i++) { flag = 0; for (j=N-1; j>i+1; j--) { if (A[j-1] > A[j]) { temp = A[j-1]; A[j-1] = A[j]; A[j] = temp; sw++; flag = 1; } } } return sw; }...
main.c:3:16: error: unknown type name 'intA'; did you mean 'int'? 3 | int bubbleSort(intA[], int N){ | ^~~~ | int main.c: In function 'main': main.c:29:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 29 | sw = bubbleSort(A, N);...
s804239380
p02259
C
#include<stdio.h> int bubbleSort(intA[], int N){ int i, j, temp; int sw = 0; int flag = 1; for (i=0; flag = 1; i++) { flag = 0; for (j=N-1; j>i+1; j--) { if (A[j-1] > A[j]) { temp = A[j-1]; A[j-1] = A[j]; A[j] = temp; sw++; flag = 1; } } } ...
main.c:3:16: error: unknown type name 'intA'; did you mean 'int'? 3 | int bubbleSort(intA[], int N){ | ^~~~ | int main.c: In function 'main': main.c:30:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 30 | sw = bubbleSort(A, N);...
s937545377
p02259
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 bubblesort(int a,int N){ int i,j,v,s; s=0; for(i=1;i<N;i++){ v=a[i]; j=i-1; for(j=N-1;j>=i;j--){ if(a[j]<v){ a[j-1]=a[j]; ...
main.c: In function 'trace': main.c:8:24: error: expected ';' before '}' token 8 | printf("%d",a[i])} | ^ | ; main.c: At top level: main.c:10:10: error: expected declaration specifiers or '...' before string constant 10 | printf("\n"); | ...
s328743276
p02259
C
#include<stdio.h> int bubbleSort(intA[], int N){ int i, j, temp; int sw = 0; int flag = 1; for (i=0; flag = 1; i++) { flag = 0; for (j=N-1; j>i+1; j--) { if (A[j-1] > A[j]) { temp = A[j-1]; A[j-1] = A[j]; A[j] = temp; sw++; flag = 1; } } } ...
main.c:3:16: error: unknown type name 'intA'; did you mean 'int'? 3 | int bubbleSort(intA[], int N){ | ^~~~ | int main.c: In function 'main': main.c:30:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 30 | sw = bubbleSort(A, N);...
s721487923
p02259
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 bubblesort(int a,int N){ int i,j,v,s; s=0; for(i=1;i<N;i++){ v=a[i]; j=i-1; for(j=N-1;j>=i;j--){ if(a[j]<v){ a[j-1]=a[j]; ...
main.c: In function 'bubblesort': main.c:17:8: error: subscripted value is neither array nor pointer nor vector 17 | v=a[i]; | ^ main.c:20:11: error: subscripted value is neither array nor pointer nor vector 20 | if(a[j]<v){ | ^ main.c:21:8: error: subscripted value is neith...
s074983069
p02259
C
#include<stdio.h> int bubbleSort(intA[], int N){ int i, j, temp; int sw = 0; int flag = 1; for (i=0; flag = 1; i++) { flag = 0; for (j=N-1; j>i+1; j--) { if (A[j-1] > A[j]) { temp = A[j-1]; A[j-1] = A[j]; A[j] = temp; sw++; flag = 1; } } } ...
main.c:3:16: error: unknown type name 'intA'; did you mean 'int'? 3 | int bubbleSort(intA[], int N){ | ^~~~ | int main.c: In function 'main': main.c:30:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 30 | sw = bubbleSort(A, N);...
s779746050
p02259
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 bubblesort(int a,int N){ int i,j,v,s; s=0; for(i=1;i<N;i++){ v=a[i]; j=i-1; for(j=N-1;j>=i;j--){ if(a[j]<v){ a[j-1]=a[j]; ...
main.c: In function 'bubblesort': main.c:17:8: error: subscripted value is neither array nor pointer nor vector 17 | v=a[i]; | ^ main.c:20:11: error: subscripted value is neither array nor pointer nor vector 20 | if(a[j]<v){ | ^ main.c:21:8: error: subscripted value is neith...
s575177017
p02259
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 bubblesort(int a,int N){ int i,j,v,s; s=0; for(i=1;i<N;i++){ v=a[i]; j=i-1; for(j=N-1;j>=i;j--){ if(a[j]<v){ a[j-1]=a[j]; ...
main.c: In function 'bubblesort': main.c:17:8: error: subscripted value is neither array nor pointer nor vector 17 | v=a[i]; | ^ main.c:20:11: error: subscripted value is neither array nor pointer nor vector 20 | if(a[j]<v){ | ^ main.c:21:8: error: subscripted value is neith...
s361391039
p02259
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 bubblesort(int a[],int N){ int i,j,v,s; s=0; for(i=1;i<N;i++){ v=a[i]; j=i-1; for(j=N-1;j>=i;j--){ if(a[j]<v){ a[j-1]=a[j];...
main.c: In function 'main': main.c:39:17: error: 's' undeclared (first use in this function) 39 | printf("%d\n",s); | ^ main.c:39:17: note: each undeclared identifier is reported only once for each function it appears in
s601515086
p02259
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 bubblesort(int a[],int N){ int i,j,v,s; s=0; for(i=1;i<N;i++){ v=a[i]; j=i-1; for(j=N-1;j>=i;j--){ if(a[j]<v){ a[j-1]=a[j];...
main.c: In function 'main': main.c:39:17: error: 's' undeclared (first use in this function) 39 | printf("%d\n",s); | ^ main.c:39:17: note: each undeclared identifier is reported only once for each function it appears in
s864562956
p02259
C
#include<stdio.h> int bubbleSort(intA[], int N){ int i, j, temp; int sw = 0; int flag = 1; for (i=0; flag = 1; i++) { flag = 0; for (j=N-1; j>i+1; j--) { if (A[j-1] > A[j]) { temp = A[j-1]; A[j-1] = A[j]; A[j] = temp; sw++; flag = 1; } } } ...
main.c:3:16: error: unknown type name 'intA'; did you mean 'int'? 3 | int bubbleSort(intA[], int N){ | ^~~~ | int main.c: In function 'main': main.c:30:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 30 | sw = bubbleSort(A, N);...
s549658086
p02259
C
#include<stdio.h> int bubbleSort(intA[], int N){ int i, j, temp; int sw = 0; int flag = 1; for (i=0; flag = 1; i++) { flag = 0; for (j=N-1; j>i+1; j--) { if (A[j-1] > A[j]) { temp = A[j-1]; A[j-1] = A[j]; A[j] = temp; sw++; flag = 1; } } } ...
main.c:3:16: error: unknown type name 'intA'; did you mean 'int'? 3 | int bubbleSort(intA[], int N){ | ^~~~ | int main.c: In function 'main': main.c:30:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 30 | sw = bubbleSort(A, N);...
s308722963
p02259
C
#include <stdio.h> int main(void) { int A[100], i, n, sw; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &A[i]); } sw = bubbleSort(A, n); for (i = 0; i < n; i++) { if (i) printf(" "); printf("%d", A[i]); } printf("\n"); printf("%d\n", sw); return 0; } int bubbleS...
main.c: In function 'main': main.c:11:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 11 | sw = bubbleSort(A, n); | ^~~~~~~~~~ main.c: In function 'bubbleSort': main.c:26:3: error: unknown type name 'bool' 26 | bool flag = 1; | ^~~~ main.c:2:1: no...
s581300326
p02259
C
#include<stdio.h> int bubbleSort(intA[], int N){ int i, j, temp; int sw = 0; int flag = 1; for (i=0; flag = 1; i++) { flag = 0; for (j=N-1; j>i+1; j--) { if (A[j-1] > A[j]) { temp = A[j-1]; A[j-1] = A[j]; A[j] = temp; sw++; flag = 1; } } } ...
main.c:3:16: error: unknown type name 'intA'; did you mean 'int'? 3 | int bubbleSort(intA[], int N){ | ^~~~ | int main.c: In function 'main': main.c:30:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 30 | sw = bubbleSort(A, N);...
s497200700
p02259
C
#include <stdio.h> void bubbleSort( int A[], int N ) { int i, j, v; int wa = 0; for ( i = 0; i < N; i++ ) { for ( j = N - 1; j > 0; j-- ) { if ( A[ j ] < A[ j - 1 ] ) { v = A[ k ]; A[ k ] = A[ k - 1 ]; A[ k - 1 ] = v; wa = wa+1; } ...
main.c: In function 'bubbleSort': main.c:11:20: error: 'k' undeclared (first use in this function) 11 | v = A[ k ]; | ^ main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
s462349417
p02259
C
#include<stdio.h> int bubbleSort(intA[], int N){ int i, j, temp; int sw = 0; int flag = 1; for (i=0; flag = 1; i++) { flag = 0; for (j=N-1; j>i+1; j--) { if (A[j-1] > A[j]) { temp = A[j-1]; A[j-1] = A[j]; A[j] = temp; sw++; flag = 1; } } } ...
main.c:3:16: error: unknown type name 'intA'; did you mean 'int'? 3 | int bubbleSort(intA[], int N){ | ^~~~ | int main.c: In function 'main': main.c:30:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 30 | sw = bubbleSort(A, N);...
s568574244
p02259
C
#include <stdio.h> int bubblesort(int a[],int N){ int i,j,s,z,flag; s=0; z=0; flag=1; for(i=0;flag;i++){ flag=0; for(j=N-1;j>=i+1;j--){ if(a[j]<a[j-1]){ z=a[j-1]; a[j-1]=a[j]; a[j]=z; flag=1; s++; } } } return s; } int main(void) { int ...
main.c: In function 'main': main.c:29:3: error: 's' undeclared (first use in this function) 29 | s=bubblesort(a,N); | ^ main.c:29:3: note: each undeclared identifier is reported only once for each function it appears in
s764129754
p02259
C
#include <stdio.h> int bubblesort(int a[],int N){ int i,j,s,z,flag; s=0; z=0; flag=1; for(i=0;flag;i++){ flag=0; for(j=N-1;j>=i+1;j--){ if(a[j]<a[j-1]){ z=a[j-1]; a[j-1]=a[j]; a[j]=z; flag=1; s++; } } } return s; } int main(void) { int ...
main.c: In function 'main': main.c:29:3: error: 's' undeclared (first use in this function) 29 | s=bubblesort(a,N); | ^ main.c:29:3: note: each undeclared identifier is reported only once for each function it appears in main.c: At top level: main.c:33:10: error: expected declaration specifiers or '...' bef...
s718716564
p02259
C
#include <stdio.h> int main() { int A[100], i, N, sw; scanf("%d", &n); for (i = 0; i < N; i++) { scanf("%d", &A[i]); } sw = bubbleSort(A, N); for (i = 0; i < N; i++) { if (i) printf(" "); printf("%d", A[i]); } printf("\n"); printf("%d\n", sw); return...
main.c: In function 'main': main.c:6:17: error: 'n' undeclared (first use in this function) 6 | scanf("%d", &n); | ^ main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in main.c:11:9: error: implicit declaration of function 'bubbleSort' [-Wimpli...
s936138378
p02259
C
#include <stdio.h> int main() { int A[100], i, N, sw; scanf("%d", &n); for (i = 0; i < N; i++) { scanf("%d", &A[i]); } sw = bubbleSort(A, N); for (i = 0; i < N; i++) { if (i) printf(" "); printf("%d", A[i]); } printf("\n"); printf("%d\n", sw); ...
main.c: In function 'main': main.c:6:17: error: 'n' undeclared (first use in this function) 6 | scanf("%d", &n); | ^ main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in main.c:11:9: error: implicit declaration of function 'bubbleSort' [-Wimpli...
s719072802
p02259
C
#include <stdio.h> int bubblesort(int a[],N){ int i,j,s,z,flag; s=0; z=0; flag=1; for(i=0;flag;i++){ flag=0; for(j=N-1;j>=i+1;j--){ if(a[j]<a[j-1]){ z=a[j-1]; a[j-1]=a[j]; a[j]=z; flag=1; s++; } } } return s; ...
main.c:3:24: error: unknown type name 'N' 3 | int bubblesort(int a[],N){ | ^ main.c: In function 'main': main.c:38:3: error: 's' undeclared (first use in this function) 38 | s=bubblesort(a,N); | ^ main.c:38:3: note: each undeclared identifier is reported only once for each ...
s346866273
p02259
C
#include <stdio.h> int bubblesort(int a[],N){ int i,j,s,z,flag; s=0; z=0; flag=1; for(i=0;flag;i++){ flag=0; for(j=N-1;j>=i+1;j--){ if(a[j]<a[j-1]){ z=a[j-1]; a[j-1]=a[j]; a[j]=z; flag=1; s++; } } } return s; ...
main.c:3:24: error: unknown type name 'N' 3 | int bubblesort(int a[],N){ | ^ main.c: In function 'main': main.c:38:5: error: implicit declaration of function 'bubblesort' [-Wimplicit-function-declaration] 38 | s=bubblesort(a,N); | ^~~~~~~~~~
s102127146
p02259
C
#include <stdio.h> int bubbleSort( int A[], int N, int wa ) { int i, j, v; for ( i = 0; i < N; i++ ) { for ( j = N - 1; j > 0; j-- ) { if ( A[ j ] < A[ j - 1 ] ) { v = A[ j ]; A[ j ] = A[ j- 1 ]; A[ j - 1] = v; wa = wa + 1; } } } ...
main.c: In function 'main': main.c:41:4: error: too few arguments to function 'bubbleSort' 41 | bubbleSort( A, N ); | ^~~~~~~~~~ main.c:3:5: note: declared here 3 | int bubbleSort( int A[], int N, int wa ) | ^~~~~~~~~~ main.c:43:28: error: passing argument 1 of 'bubbleSort' makes pointer fr...
s965027880
p02259
C
#include <stdio.h> int bubbleSort( int A[], int N, int wa ) { int i, j, v; for ( i = 0; i < N; i++ ) { for ( j = N - 1; j > 0; j-- ) { if ( A[ j ] < A[ j - 1 ] ) { v = A[ j ]; A[ j ] = A[ j- 1 ]; A[ j - 1] = v; wa = wa + 1; } } } ...
main.c: In function 'main': main.c:41:4: error: too few arguments to function 'bubbleSort' 41 | bubbleSort( A, N ); | ^~~~~~~~~~ main.c:3:5: note: declared here 3 | int bubbleSort( int A[], int N, int wa ) | ^~~~~~~~~~ main.c:43:30: error: passing argument 1 of 'bubbleSort' makes pointer fr...
s077856483
p02259
C
#include <stdio.h> int main(void) { int i, n, s, f, count = 0; int a[100]; scanf("%d", &n); for( i = 0; i < n; i++){ scanf("%d", &a[i]); } f = 1; while(f){ f = 0; for( i = n-1; i > 0; i--){ if( a[i] < a[i-1]){ s = a[i]; a[i] = a[i-1]; a[i-1]= s; f = 1; count = count + 1...
main.c: In function 'main': main.c:36:1: error: expected declaration or statement at end of input 36 | } | ^
s513486239
p02259
C
#include <stdio.h> int main(void) { int i, n, s, f, count = 0; int a[100]; scanf("%d", &n); for( i = 0; i < n; i++){ scanf("%d", &a[i]); } f = 1; while(f){ f = 0; for( i = n-1; i > 0; i--){ if( a[i] < a[i-1]){ s = a[i]; a[i] = a[i-1]; a[i-1]= s; f = 1; count = count + 1...
main.c: In function 'main': main.c:36:1: error: expected declaration or statement at end of input 36 | } | ^
s300592433
p02259
C
#include<stdio.h> int main(){ int n, i, j, flag, count, A; int data[99]; count = 0; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d", data[i]); } flag = 1; while(flag){ flag = 0; for(j = n-1; j >=1; j--){ if data[j] < data[j-1]{ A = data[j]; data[j] = data[j-1];...
main.c: In function 'main': main.c:17:10: error: expected '(' before 'data' 17 | if data[j] < data[j-1]{ | ^~~~ | ( main.c:26:24: error: expected ';' before 'for' 26 | printf("%d", data[0]) | ^ | ; 27 | for(i = 1;...
s023149188
p02259
C
#include<stdio.h> int main(){ int n, i, j, flag, count, A; int data[99]; count = 0; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d", data[i]); } flag = 1; while(flag){ flag = 0; for(j = n-1; j >=1; j--){ if data[j] < data[j-1]{ A = data[j]; data[j] = data[j-1];...
main.c: In function 'main': main.c:17:10: error: expected '(' before 'data' 17 | if data[j] < data[j-1]{ | ^~~~ | ( main.c:26:24: error: expected ';' before 'for' 26 | printf("%d", data[0]) | ^ | ; 27 | for(i = 1;...
s598865778
p02259
C
#include<stdio.h> int main(){ int n, i, j, flag, count, A; int data[99]; count = 0; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d", data[i]); } flag = 1; while(flag){ flag = 0; for(j = n-1; j >=1; j--){ if data[j] < data[j-1]{ A = data[j]; data[j] = data[j-1];...
main.c: In function 'main': main.c:17:10: error: expected '(' before 'data' 17 | if data[j] < data[j-1]{ | ^~~~ | ( main.c:28:5: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration] 28 | pirntf(" %d", data[i]); | ...
s425237290
p02259
C
#include<stdio.h> int main(){ int n, i, j, flag, count, A; int data[99]; count = 0; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d", data[i]); } flag = 1; while(flag){ flag = 0; for(j = n-1; j >0; j--){ if (data[j] < data[j-1]){ A = data[j]; data[j] = data[j-1]...
main.c: In function 'main': main.c:28:5: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration] 28 | pirntf(" %d", data[i]); | ^~~~~~ | printf
s748691714
p02259
C
#include <stdio.h> int main() { int v,n,i,j,A[1000]; int count,c; c=0; j = n-1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]); } while(c<n){ ???while(j>=c){ if(A[j]???A[j+1]){ ...
main.c: In function 'main': main.c:16:11: error: expected expression before '?' token 16 | ???while(j>=c){ | ^ main.c:29:11: error: expected expression before '?' token 29 | ???printf("%d\n",A[n]); | ^
s139992228
p02259
C
#include <stdio.h> int main() { int v,n,i,j,A[1000]; int count,c; c=0; j = n-1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]); } while(c<n){ ???while(j>=c){ if(A[j]???A[j+1]){ ...
main.c: In function 'main': main.c:16:11: error: expected expression before '?' token 16 | ???while(j>=c){ | ^ main.c:29:11: error: expected expression before '?' token 29 | ???printf("%d\n",A[n]); | ^
s503757421
p02259
C
#include <stdio.h> int main() { int v,n,i,j,A[1000]; int count,c; c=0; j = n-1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]); } while(c<n){ ???while(j>=c){ if(A[j]???A[j+1]){ v=A[j]; ...
main.c: In function 'main': main.c:15:11: error: expected expression before '?' token 15 | ???while(j>=c){ | ^ main.c:27:11: error: expected expression before '?' token 27 | ???printf("%d\n",A[n]); | ^
s950916916
p02259
C
#include <stdio.h> int main() { int v,n,i,j,A[1000]; int count,c=1; c=0; j = n-1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]); } while(j){ j=0 ???for(i=1;i<n;i++) if(A[i]<A[i-1]){ ...
main.c: In function 'main': main.c:16:12: error: expected expression before '?' token 16 | ???for(i=1;i<n;i++) | ^ main.c: At top level: main.c:26:11: error: expected identifier or '(' before 'for' 26 | for(i=0;i<n;i++){ | ^~~ main.c:26:20: error: expected '=',...
s368760414
p02259
C
#include<stdio.h> int main(){ int v,n,i,j,A[1000]; int count; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",A[i]);} while(j){ j=0; for(i=1;i<n;i++){ if(A[i]<A[i-1]){ v=A[i]; A[i]=A[i-1]; A[i-1]=v; count++; j++; } } } for(i=0;i<n;i++){ printf("%d ",A[i]); if(i==n-1)printf("%d\n",A[i])...
main.c: In function 'main': main.c:29:1: error: expected declaration or statement at end of input 29 | } | ^
s402413963
p02259
C
#include<stdio.h> int main(){ int v,n,i,j,A[100]; int count=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]);} for(j=0;j<n;j++) for(i=n-1;i>j;i--){ if(A[i]<A[i-1]){ v=A[i]; A[i]=A[i-1]; A[i-1]=v; count++; } } } for(i=0;i<n;i++){ printf("%d ",A[i]);} if(i==n-1)printf("%d\n",A[i]); pr...
main.c:21:2: error: expected identifier or '(' before 'for' 21 | for(i=0;i<n;i++){ | ^~~ main.c:21:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 21 | for(i=0;i<n;i++){ | ^ main.c:21:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' toke...
s379613391
p02259
C
#include<stdio.h> int main(){ int v,i,n,j,a[100]; int c = 0; scanf("%d",&n); for(i = 0;i < n;i++){ scanf("%d",&a[i]);} for(j = 0;j < n;j++){ for(i = n-1;i > j; i--){ if(a[i]<a[i-1]){ v = a[i]; a[i] = a[i - 1]; a[i - 1] = v; c++; } } } for(i = 0;i < n;i++){ if(i == n-1) printf("%d\n",a[i]); else ...
main.c: In function 'main': main.c:23:15: error: 'A' undeclared (first use in this function) 23 | printf("%d",A[i]); | ^ main.c:23:15: note: each undeclared identifier is reported only once for each function it appears in
s798082626
p02259
C
#include <stdio.h> ?? int main(){ ?? int i,j; int A[101]; int len, tmp; int count=0; scanf("%d",&len); ?? for(i=1; i<=len; i++){ scanf("%d",&A[i]); } ?? for(i=1; i<=len-1; i++){ ?? for(j=len; j >=i+1; j--){ ?? if(A[j] < A[j-1]){ tmp = A[j]; A[j] = A[j-1]; A[j-1] = tmp; count++; } ?? } ?? } for(i=1; i<=len; i++){ p...
main.c:2:1: error: expected identifier or '(' before '?' token 2 | ?? | ^
s262787312
p02259
C
#include<stdio.h> int main(){ int n; int x[100]; int i; int a; int j, k; int count = 0; scanf("%d", &n); for(i=0; i<n; i++){ scanf("%d", &arr[i]); } for(j=n-1; j>=0; j--){ for(k=n-1; k>=0; k--){ if(x[k-1]>x[k]){ a = x[k-1]; x[k-1] = x[k]; x[k] = a; count++; } } } for(i=0; i<n; i++){ if(i...
main.c: In function 'main': main.c:21:14: error: 'arr' undeclared (first use in this function) 21 | scanf("%d", &arr[i]); | ^~~ main.c:21:14: note: each undeclared identifier is reported only once for each function it appears in
s321410243
p02259
C
#include<stdio.h> void bubbleSort(int A[], int N){ int i, j, k, count = 0; for( i = 0; i < N; i++ ){ for(j = i + 1 ; j < N; j++ ){ if(A[i] > A[j]){ k = A[j]; A[j] = A[i]; A[i] = k; count += 1; } } } space(A, N); } void space(int A[], int N){ int i; for( ...
main.c: In function 'bubbleSort': main.c:15:3: error: implicit declaration of function 'space' [-Wimplicit-function-declaration] 15 | space(A, N); | ^~~~~ main.c: At top level: main.c:18:6: warning: conflicting types for 'space'; have 'void(int *, int)' 18 | void space(int A[], int N){ | ^~~~...
s721180012
p02259
C
#include<stdio.h> void bubbleSort(int a[],int n){ int flag = 1; int i,j,n,v,a[100]; int c = 0; while ( flag == 1) { flag = 0; for ( j = n - 1; j >= 1; j-- ) { if ( a[j] < a[j - 1] ) { v = a[j]; a[j] = a[j - 1]; a[j - 1] = v; ...
main.c: In function 'bubbleSort': main.c:5:9: error: 'n' redeclared as different kind of symbol 5 | int i,j,n,v,a[100]; | ^ main.c:3:29: note: previous definition of 'n' with type 'int' 3 | void bubbleSort(int a[],int n){ | ~~~~^ main.c:5:13: error: 'a' redeclared as ...
s615315598
p02259
C
#include<stdio.h> void bubbleSort(int a[],int n){ int flag = 1; int i,j,n,v,a[100]; int c = 0; while ( flag == 1) { flag = 0; for ( j = n - 1; j >= 1; j-- ) { if ( a[j] < a[j - 1] ) { v = a[j]; a[j] = a[j - 1]; a[j - 1] = v; ...
main.c: In function 'bubbleSort': main.c:5:9: error: 'n' redeclared as different kind of symbol 5 | int i,j,n,v,a[100]; | ^ main.c:3:29: note: previous definition of 'n' with type 'int' 3 | void bubbleSort(int a[],int n){ | ~~~~^ main.c:5:13: error: 'a' redeclared as ...
s830099257
p02259
C
#include<stdio.h> void bubbleSort(int a[],int n) { int flag = 1; int i,j,v; int c = 0; while ( flag == 1) { flag = 0; for ( j = n - 1; j >= 1; j-- ) { if ( a[j] < a[j - 1] ) { v = a[j]; a[j] = a[j - 1]; a[j - 1] = v; ...
main.c: In function 'main': main.c:27:1: error: expected ',' or ';' before 'int' 27 | int i,j,n,v,a[100]; | ^~~ main.c:30:18: error: 'n' undeclared (first use in this function) 30 | scanf("%d", &n); | ^ main.c:30:18: note: each undeclared identifier is reported only once for each ...
s807399618
p02259
C
#include<stdio.h> void bubbleSort(int a[],int n) { int flag = 1; int i,j,v; int c = 0; while ( flag == 1) { flag = 0; for ( j = n - 1; j >= 1; j-- ) { if ( a[j] < a[j - 1] ) { v = a[j]; a[j] = a[j - 1]; a[j - 1] = v; ...
main.c: In function 'main': main.c:27:1: error: expected ',' or ';' before 'int' 27 | int i,j,n,v,a[100]; | ^~~ main.c:30:18: error: 'n' undeclared (first use in this function) 30 | scanf("%d", &n); | ^ main.c:30:18: note: each undeclared identifier is reported only once for each ...
s040643925
p02259
C
#include<stdio.h> int main(void){ int flag = 1 int i,j,n,v,a[100]; int c =0; scanf("%d", &n); for ( i = 0; i < n; i++ ) scanf("%d", &a[i]); bubbleSort(a,n); printf("%d",a[0]); for ( i = 1; i < n; i++ ) { printf(" %d\n", a[i]); } printf("%d\n", c); return 0; } void bubbleS...
main.c: In function 'main': main.c:7:1: error: expected ',' or ';' before 'int' 7 | int i,j,n,v,a[100]; | ^~~ main.c:10:18: error: 'n' undeclared (first use in this function) 10 | scanf("%d", &n); | ^ main.c:10:18: note: each undeclared identifier is reported only once for each f...
s978920566
p02259
C
#include<stdio.h> int main(void){ int flag = 1; int i,j,n,v,a[100]; int c =0; scanf("%d", &n); for ( i = 0; i < n; i++ ){ scanf("%d", &a[i]); } bubbleSort(a,n) for ( i = 0; i < n; i++ ) { printf(" %d\n", a[i]); if(i==n-1){ printf("\n"); } else printf(" "); } p...
main.c: In function 'main': main.c:14:1: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 14 | bubbleSort(a,n) | ^~~~~~~~~~ main.c:14:16: error: expected ';' before 'for' 14 | bubbleSort(a,n) | ^ | ; 15 | 16 | for ( i...
s052059727
p02259
C
#include<stdio.h> int main(void){ int flag = 1; int i,j,N,v,a[100]; int c =0; scanf("%d", &N); for ( i = 0; i < N; i++ ){ scanf("%d", &a[i]); } bubbleSort(a,N); for ( i = 0; i < N; i++ ) { printf(" %d\n", a[i]); if(i==N-1){ printf("\n"); } else if{ printf(" "); } } ...
main.c: In function 'main': main.c:14:1: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration] 14 | bubbleSort(a,N); | ^~~~~~~~~~ main.c:21:8: error: expected '(' before '{' token 21 | else if{ printf(" "); | ^ | ( main.c: At top level: main.c:33:6:...
s852843736
p02259
C
#include<stdio.h> int main(void){ int flag = 1; int i,j,n,v,a[10000]; int c =0; scanf("%d", &n); for ( i = 0; i < n; i++ ){ scanf("%d", &a[i]); } while ( flag ) { flag = 0; for ( j = n - 1; j >= 1; j-- ) { if ( a[j] < a[j - 1] ) { v = a[j]; a...
main.c:28:5: error: expected identifier or '(' before 'for' 28 | for ( i = 0; i < n; i++ ) { | ^~~ main.c:28:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 28 | for ( i = 0; i < n; i++ ) { | ^ main.c:28:26: error: expected '=', ',', ';', 'as...
s112577695
p02259
C
#include<stdio.h> int main(){ ????int n, k, A[100]; ????int count = 0; ?? ????scanf("%d", &n); ????for ( i = 0; i < n; i++ ){ ???? scanf("%d", &A[ i ] ); ????} ?????? for ( i = n-1; i > 0; i-- ){ if(A[i] < A[i-1]){ k = A[i]; A[i] = A[i-1]; A[i-1] = k; count++; } } for ( i = 0; ...
main.c: In function 'main': main.c:5:1: error: expected expression before '?' token 5 | ????int n, k, A[100]; | ^ main.c:6:1: error: expected expression before '?' token 6 | ????int count = 0; | ^ main.c:7:1: error: expected expression before '?' token 7 | ?? | ^ main.c:8:18: error: 'n' un...
s900845750
p02259
C
#include<stdio.h> int main(){ ????int n, k, A[100]; ????int count = 0; ?? ????scanf("%d", &n); ????for ( i = 0; i < n; i++ ){ ???? scanf("%d", &A[ i ] ); ????} ?????? for ( i = n-1; i >= 0; i-- ){ if(A[i] < A[i-1]){ k = A[i]; A[i] = A[i-1]; A[i-1] = k; count++; } } for ( i = 0;...
main.c: In function 'main': main.c:5:1: error: expected expression before '?' token 5 | ????int n, k, A[100]; | ^ main.c:6:1: error: expected expression before '?' token 6 | ????int count = 0; | ^ main.c:7:1: error: expected expression before '?' token 7 | ?? | ^ main.c:8:18: error: 'n' un...
s360407219
p02259
C
#include<stdio.h> int main(){ ????int n, k, A[100]; ????int count = 0; ?? ????scanf("%d", &n); ????for ( i = 0; i < n; i++ ){ ???? scanf("%d", &A[ i ] ); ????} ????for ( i = 0; i < n; i++){?? for ( j = n-1; j >= 0; j-- ){ if(A[j] < A[j-1]){ k = A[j]; A[j] = A[j-1]; A[j-1] = k; ...
main.c: In function 'main': main.c:5:1: error: expected expression before '?' token 5 | ????int n, k, A[100]; | ^ main.c:6:1: error: expected expression before '?' token 6 | ????int count = 0; | ^ main.c:7:1: error: expected expression before '?' token 7 | ?? | ^ main.c:8:18: error: 'n' un...
s046423827
p02259
C
#include<stdio.h> int main(void){ int n,flag,count,A; int data[99]; count=0; scanf("%d",&n); int i,j; for(i=0;i<n;i++){ scanf("%d",&data[i]); } flag=1; while(flag){ fla =0; for(j=n-1; j>=1;j--){ if(data[j]<data[j-1]){ A=data[j]; data[j]=data[j-1]; data[j-1]=A; count++; flag=1; } } } printf("%d",data[0]); for(i=1; ...
main.c: In function 'main': main.c:14:1: error: 'fla' undeclared (first use in this function); did you mean 'flag'? 14 | fla =0; | ^~~ | flag main.c:14:1: note: each undeclared identifier is reported only once for each function it appears in
s448028141
p02259
C
#include<stdio.h> int main(void){ int n,flag,count,A; int data[99]; count=0; scanf("%d",&n); int i,j; for(i=0;i<n;i++){ scanf("%d",&data[i]); } fla=1; while(flag){ fla =0; for(j=n-1; j>=1;j--){ if(data[j]<data[j-1]){ A=data[j]; data[j]=data[j-1]; data[j-1]=A; count++; flag=1; } } } printf("%d",data[0]); for(i=1; i...
main.c: In function 'main': main.c:12:1: error: 'fla' undeclared (first use in this function); did you mean 'flag'? 12 | fla=1; | ^~~ | flag main.c:12:1: note: each undeclared identifier is reported only once for each function it appears in
s267565070
p02259
C
#include<stdio.h> int main(void){ int n,flag,count,A; int data[99]; count=0; scanf("%d",&n); int i,j; for(i=0;i<n;i++){ scanf("%d",&data[i]); } flag=1; while(flag){ flag0; for(j=n-1; j>=1;j--){ if(data[j]<data[j-1]){ A=data[j]; data[j]=data[j-1]; data[j-1]=A; count++; flag=1; } } } printf("%d",data[0]); for(i=1; i...
main.c: In function 'main': main.c:14:1: error: 'flag0' undeclared (first use in this function); did you mean 'flag'? 14 | flag0; | ^~~~~ | flag main.c:14:1: note: each undeclared identifier is reported only once for each function it appears in
s275114438
p02259
C
#include<stdio.h> int main(void){ int X,Y; int A[1000]; int i=0; while((scanf("%d",&X))!='\n'){ int N=X; //????´???° } while((scanf("%d",&Y))!=EOF){ A[i] = Y; i++; } int flag=1; int change=0; //???????????° while(flag){ flag=0; for(int j=N-1; i>=1; j--){ if(A[j]<A[j-1]){ int stock = A[j]; ...
main.c: In function 'main': main.c:18:27: error: 'N' undeclared (first use in this function) 18 | for(int j=N-1; i>=1; j--){ | ^ main.c:18:27: note: each undeclared identifier is reported only once for each function it appears in
s544404571
p02259
C
//2-bubbleSort int main(){ int A[100]; int N;; fgets(A, 100, stdin); bubbleSort(A, N); } void bubbleSort(int A[], int N){ int i, j, tmp; for(i=0; i<(N - 1); i++){ for(j=(N - 1); j>i; j--){ if(A[j-1] > A[j]){ temp = A[j-1]; A[j-1] = A[j]; A[j] = tmp; } } } }
main.c: In function 'main': main.c:6:3: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration] 6 | fgets(A, 100, stdin); | ^~~~~ main.c:6:17: error: 'stdin' undeclared (first use in this function) 6 | fgets(A, 100, stdin); | ^~~~~ main.c:1:1: note: 's...
s756301563
p02259
C
int main(){ int A[100]; fgets(A, 100, stdin); bubbleSort(A, N); } void bubbleSort(int A[], int N){ int i, j, tmp; for(i=0; i<(N - 1); i++){ for(j=(N - 1); j>i; j--){ if(A[j-1] > A[j]){ temp = A[j-1]; A[j-1] = A[j]; A[j] = tmp; } } } }
main.c: In function 'main': main.c:3:3: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration] 3 | fgets(A, 100, stdin); | ^~~~~ main.c:3:17: error: 'stdin' undeclared (first use in this function) 3 | fgets(A, 100, stdin); | ^~~~~ main.c:1:1: note: 's...
s927646843
p02259
C
#include<stdio.h> int main(void){ int X,Y, N; int A[1000]; int i=0; //while((scanf("%d",&X))!='\n'){ // N=X; //????´???° //} scanf("%d",&N); while((scanf("%d",&Y))!=EOF){ A[i] = Y; i++; } int flag=1; int change=0; //???????????° while(fla-1g){ flag=0; for(int j=N-1; i>=1; j--){ if(A[j]<A[j-1])...
main.c: In function 'main': main.c:18:15: error: 'fla' undeclared (first use in this function); did you mean 'flag'? 18 | while(fla-1g){ | ^~~ | flag main.c:18:15: note: each undeclared identifier is reported only once for each function it appears in main.c:18:19: erro...
s210742521
p02259
C
#include <stdio.h> int i,j; int count=0; void Process(int A[ ], int n){ for(i=0;i<n-1;i++) printf("%d ",A[i]); printf("%d\n",A[i]); } void BubbleSort(int A[ ], int n){ int j,temp; for(i = 0; i < N-1; i++){ for(j = N-1; j > i; j--) if(A[j-1] > A[j]){ temp = A[j-1]; A[j-1] = A[j]; A[j] = temp...
main.c: In function 'BubbleSort': main.c:15:32: error: 'N' undeclared (first use in this function) 15 | for(i = 0; i < N-1; i++){ | ^ main.c:15:32: note: each undeclared identifier is reported only once for each function it appears in
s678285206
p02259
C
#include <cstdio> int a[100],n,count = 0; void print(){ for(int i=0;i<n;i++){ if(i>0) printf(" "); printf("%d",a[i]); } printf("\n"); printf("%d\n", count); } void bubbleSort(){ int i = 0,j,flag = 1,tmp; while(flag == 1){ flag = 0; for(j=n-1;j>i;j--){ ...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.