submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s599605070 | p02259 | C | #include<stdio.h>
int main(void){
int n;
int a[100];
int i;
int box;
int count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i = 0;i < n-1;i++){
for(j = 0;j < n-1-i;j++){
if(a[j] > a[j+1]){
box = a[j];
a[j] = a[j+1];
a[j+1] = box;
count += 1;
}
}
}
for(i = 0;i... | main.c: In function 'main':
main.c:15:21: error: 'j' undeclared (first use in this function)
15 | for(j = 0;j < n-1-i;j++){
| ^
main.c:15:21: note: each undeclared identifier is reported only once for each function it appears in
|
s805531541 | p02259 | C | #include<stdio.h>
int main(void){
int n;
int a[100];
int i.j;
int box;
int count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i = 0;i < n-1;i++){
for(j = 0;j < n-1-i;j++){
if(a[j] > a[j+1]){
box = a[j];
a[j] = a[j+1];
a[j+1] = box;
count += 1;
}
}
}
for(i = 0... | main.c: In function 'main':
main.c:6:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
6 | int i.j;
| ^
main.c:6:14: error: expected expression before '.' token
main.c:11:13: error: 'i' undeclared (first use in this function)
11 | for(i=0;i<n;i++){
... |
s864803392 | p02259 | C | #import <stdio.h>
int main() {
int N;
scanf("%d", &N);
int V[N];
for (int i = 0; i < N; i++) {
scanf("%d", V[i]);
}
int reversed_flag;
int swap_count = 0;
// sort
do {
reversed_flag = 0;
for (int i = N - 1; i < 2; i--) {
if (V[i] < if V[i - ... | main.c:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import <stdio.h>
| ^~~~~~
main.c: In function 'main':
main.c:22:24: error: expected expression before 'if'
22 | if (V[i] < if V[i - 1]) {
| ^~
|
s254322209 | p02259 | C | #include <stdio.h>
void print(int array[], int size) {
for(int i = 0; i < size-1; i++) {
printf("%d ", array[i]);
}
printf("%d\n", array[size-1]);
return;
}
void swap(int &a, int &b) {
int &tmp = a;
a = b;
b = tmp;
}
void bubble_sort(int array[], int size) {
for(int i = size-1; i > 0; i--) {
for(int j ... | main.c:12:15: error: expected ';', ',' or ')' before '&' token
12 | void swap(int &a, int &b) {
| ^
main.c: In function 'bubble_sort':
main.c:22:33: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
22 | swap(&array[i], &array[j]);... |
s121988141 | p02259 | C | #include <stdio.h>
using namespace std;
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 flag = 1;
int j, v, count=0;
while(flag){
flag = 0;
for(j=N-1; j >=1; j--){
if (A[j] < A[j-1]){... | main.c:2:1: error: unknown type name 'using'
2 | using namespace std;
| ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
2 | using namespace std;
| ^~~
|
s852431591 | p02259 | C | #include <stdio.h>
#include <stdlib.h>
int main()
{
int n,a[101];
int i=0,j=0,q=0;
int p=0,t;
scanf("%d",&n);
for(q=0;q<n;q++)
{
scanf("%d",&a[q]);
}
for(i=0;i<n-1;i++)
{
for(j=0;j<n-i-1;j++)
{
if(a[j]>a[j+1])
... | main.c: In function 'main':
main.c:34:5: error: expected declaration or statement at end of input
34 | return 0;
| ^~~~~~
|
s420641314 | p02259 | C | #include<stdio.h>
void show(int A[],int N){
for (int i = 0; i < N; i++) {
printf("%d",A[i] );
if(i!=N-1)printf(" " );
}
}
int bubble (int A[],int N){
int i ,j;
int c;
j=N;
int sw;
for (i= j-1; 0<j; i--) {
if(A[i]<A[i-1]){
sw=A[i-1];
A[i-1]=A[i];
A[i]=sw;
c++;
... | main.c: In function 'bubble':
main.c:24:10: error: expected expression before ']' token
24 | show(A[],N);
| ^
|
s985047702 | p02259 | C | #include <stdio.h>
void bubblesort(int A[],int N,int count){
int i ,j;
int tmp,count;
count = 0
for(i = N; i <1; i-- ){
for(j = N; j < N-i+1; j--){
if(A[j] > A[j-1]){
tmp = A[j];
A[j] = A[j-1];
A[j-1] = tmp;
}
count++
}
}
}
void trace(int A[],int N,int count... | main.c: In function 'bubblesort':
main.c:5:11: error: 'count' redeclared as different kind of symbol
5 | int tmp,count;
| ^~~~~
main.c:3:35: note: previous definition of 'count' with type 'int'
3 | void bubblesort(int A[],int N,int count){
| ~~~~^~~~~
main.c... |
s623576457 | p02259 | C | #include <stdio.h>
void bubblesort(int A[],int N,int count){
int i ,j;
int tmp,count;
count = 0
for(i = N; i <1; i-- ){
for(j = N; j < N-i+1; j--){
if(A[j] > A[j-1]){
tmp = A[j];
A[j] = A[j-1];
A[j-1] = tmp;
}
count++
}
}
}
void trace(int A[],int N,int count... | main.c: In function 'bubblesort':
main.c:5:11: error: 'count' redeclared as different kind of symbol
5 | int tmp,count;
| ^~~~~
main.c:3:35: note: previous definition of 'count' with type 'int'
3 | void bubblesort(int A[],int N,int count){
| ~~~~^~~~~
main.c... |
s109994194 | p02259 | C | #include <stdio.h>
void bubblesort(int A[],int N,int count){
int i ,j;
int tmp;
count = 0
for(i = N; i <1; i-- ){
for(j = N; j < N-i+1; j--){
if(A[j] > A[j-1]){
tmp = A[j];
A[j] = A[j-1];
A[j-1] = tmp;
}
count++
}
}
}
void trace(int A[],int N,int count){
i... | main.c: In function 'bubblesort':
main.c:6:12: error: expected ';' before 'for'
6 | count = 0
| ^
| ;
7 | for(i = N; i <1; i-- ){
| ~~~
|
s979713346 | p02259 | C | #include <stdio.h>
void bubblesort(int A[],int N,int count){
int i ,j;
int tmp;
count = 0
for(i = N; i <1; i-- ){
for(j = N; j < N-i+1; j--){
if(A[j] > A[j-1]){
tmp = A[j];
A[j] = A[j-1];
A[j-1] = tmp;
}
count++;
}
}
}
void trace(int A[],int N,int count){
... | main.c: In function 'bubblesort':
main.c:6:12: error: expected ';' before 'for'
6 | count = 0
| ^
| ;
7 | for(i = N; i <1; i-- ){
| ~~~
|
s249242688 | p02259 | C | 3
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<stdio.h>
void print(int* A, int N){
int i;
for(i = 0; i < N; i++){
if(i) printf(" ");
printf("%d",A[i]);
}
printf("\n");
}
int bubble_sort(int* A, int N){
int i,j, cnt = 0;
for(i = 0; i < N; i++)
for(j = N-1; j >= i+1; j--)
... | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 3
| ^
In file included from /usr/include/stdio.h:47,
from main.c:21:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t'
28 | ... |
s552032848 | p02259 | C | #include<iostream>
using namespace std;
int A[100],N,sw;
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:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s092463631 | p02259 | C | #include<stdio.h>
int main(){
int n,a[100],count=0;
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
for(int i=0;i<n;i++){
for(int j=n;j>i;j--){
if(a[j]>a[j-1]){
swap(&a[j],&a[j-1]);
count++;
}
}
}
for(int i=0;i<n;i++)
printf("%d%s",&a[i],i!=n-1?"":"\n");
printf("%d\n",count);
retu... | main.c: In function 'main':
main.c:10:33: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
10 | swap(&a[j],&a[j-1]);
| ^~~~
|
s006166149 | p02259 | C | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int i = 0, j = 0, n, count = 0;
int seisu[20];
char str[20];
char tok[20][20];
scanf("%d", &n);
while (getchar() != '\n');
fgets(str, sizeof(str), stdin);
char *p = str;
strtok(p, " ");
strcpy(tok[i], ... | main.c:56:17: error: expected identifier or '(' before 'if'
56 | if (p == NULL)
| ^~
main.c:58:24: error: unknown type name 'tok'
58 | strcpy(tok[i], p);
| ^~~
main.c:58:32: error: unknown type name 'p'
58 | strc... |
s203228071 | p02259 | C | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int i = 0, j = 0, n, count = 0;
int seisu[20];
char str[20];
char tok[20][20];
scanf("%d", &n);
while (getchar() != '\n');
fgets(str, sizeof(str), stdin);
char *p = str;
strtok(p, " ");
strcpy(tok[i], ... | main.c:56:17: error: expected identifier or '(' before 'if'
56 | if (p == NULL)
| ^~
main.c:58:24: error: unknown type name 'tok'
58 | strcpy(tok[i], p);
| ^~~
main.c:58:32: error: unknown type name 'p'
58 | strc... |
s653546156 | p02259 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int i = 0, j = 0, n, count = 0;
int seisu[20];
char str[20];
char tok[20][20];
scanf("%d", &n);
while (getchar() != '\n');
fgets(str, sizeof(str), stdin);
char *p = str;
strtok(p, " ");
strcpy(tok[i], p);
while (1) {
i++;
p = s... | main.c:55:17: error: expected identifier or '(' before 'if'
55 | if (p == NULL)
| ^~
main.c:57:24: error: unknown type name 'tok'
57 | strcpy(tok[i], p);
| ^~~
main.c:57:32: error: unknown type name 'p'
57 | strc... |
s307443551 | p02259 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int i = 0, j = 0, n, count = 0;
int seisu[20];
char str[20];
char tok[20][20];
scanf("%d", &n);
while (getchar() != '\n');
fgets(str, sizeof(str), stdin);
char *p = str;
strtok(p, " ");
strcpy(tok[i], p);
while (1) {
i++;
p = s... | main.c:55:17: error: expected identifier or '(' before 'if'
55 | if (p == NULL)
| ^~
main.c:57:24: error: unknown type name 'tok'
57 | strcpy(tok[i], p);
| ^~~
main.c:57:32: error: unknown type name 'p'
57 | strc... |
s027606674 | p02259 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int i = 0, j = 0, n, count = 0;
int seisu[20];
char str[20];
char tok[20][20];
scanf("%d", &n);
while (getchar() != '\n');
fgets(str, sizeof(str), stdin);
char *p = str;
strtok(p, " ");
strcpy(tok[i], p);
while (1) {
i++;
p = s... | main.c:55:17: error: expected identifier or '(' before 'if'
55 | if (p == NULL)
| ^~
main.c:57:24: error: unknown type name 'tok'
57 | strcpy(tok[i], p);
| ^~~
main.c:57:32: error: unknown type name 'p'
57 | strc... |
s153468405 | p02259 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int i = 0, j = 0, n, count = 0;
int seisu[20];
char str[20];
char tok[20][20];
scanf("%d", &n);
while (getchar() != '\n');
fgets(str, sizeof(str), stdin);
char *p = str;
strtok(p, " ");
strcpy(tok[i], p);
while (1) {
i++;
p = s... | main.c:55:17: error: expected identifier or '(' before 'if'
55 | if (p == NULL)
| ^~
main.c:57:24: error: unknown type name 'tok'
57 | strcpy(tok[i], p);
| ^~~
main.c:57:32: error: unknown type name 'p'
57 | strc... |
s604020970 | p02259 | C | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int kuuhaku(char str[], char tok[][20][20],int seisu[], int n)
{
char *p = str;
int i = 0;
strtok(p, " ");
strcpy(tok[i], p);
while (1) {
i++;
p = strtok(NULL, " ");
if (p == NULL)
break;
strcpy(tok[0][i], p);
}
... | main.c: In function 'kuuhaku':
main.c:12:19: error: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
12 | strcpy(tok[i], p);
| ^
| |
| char (*)[20]
In file included from main.c:4:
/usr/include/... |
s922331317 | p02259 | C | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int kuuhaku(char str[], char tok[][20][20],int seisu[], int n)
{
char *p = str;
int i = 0;
strtok(p, " ");
strcpy(tok[i], p);
while (1) {
i++;
p = strtok(NULL, " ");
if (p == NULL)
break;
strcpy(tok[0][i], p);
}
... | main.c: In function 'kuuhaku':
main.c:12:19: error: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
12 | strcpy(tok[i], p);
| ^
| |
| char (*)[20]
In file included from main.c:4:
/usr/include/... |
s896833702 | p02259 | C | ##define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int kuuhaku(char str[], char tok[][20][20],int seisu[], int n)
{
char *p = str;
int i = 0;
strtok(p, " ");
strcpy(tok[i], p);
while (1) {
i++;
p = strtok(NULL, " ");
if (p == NULL)
break;
strcpy(tok[0][i], p);
}... | main.c:1:1: error: stray '##' in program
1 | ##define _CRT_SECURE_NO_WARNINGS
| ^~
main.c:1:3: error: unknown type name 'define'
1 | ##define _CRT_SECURE_NO_WARNINGS
| ^~~~~~
main.c:1:33: error: expected ';' before 'typedef'
1 | ##define _CRT_SECURE_NO_WARNINGS
| ... |
s614667534 | p02259 | C |
int main(void)
{
int i = 0, j = 0, n = 0, count = 0;
int seisu[250];
char str[250];
char tok[250];
scanf("%d", &n);
while (getchar() != '\n');
fgets(str, sizeof(str), stdin);
kuuhaku(str, &tok, seisu, n);
count = swap1(seisu, count, n);
for (i = 0; i < n; i++) {
printf("%d ", seisu[i]);
}
pu... | main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
10 | scanf("%d", &n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 |
main.c:10:9: warning: incompatib... |
s420060212 | p02259 | C | #include <iostream>
#define maxn 150
using namespace std;
int s[maxn];
int main()
{
int N,t,ans=0,cas=0;
cin>>N;
for(int i=0;i<N;i++){
cin>>s[i];
}
for(int i=0;i<=N-1;i++){
for(int j=N-1;j>=i+1;j--){
if(s[j]<s[j-1]){
t=s[j];
s[j]=s[j-1];
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s793948566 | p02259 | C |
void trace(int A[], int N) {
int i;
for (i=0; i++; i<N){
printf("%d", A[i]);
}
printf("\n");
}
bubbleSort(A, N)
{
int j, flag;
flag = 1;
while flag{
flag = 0;
for (j=N-1; j--; 1<=j) {
if A[j] < A[j-1] {
A[j] = A[j-1];
flag = 1;
}
}
}
}
int main() {
int N, i, j;
int A[100];
scanf("%d", &N);... | main.c: In function 'trace':
main.c:5:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
5 | printf("%d", A[i]);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 |
main.c:5:3: warning: incompatible impl... |
s642942570 | p02259 | C |
void trace(int A[], int N) {
int i;
for (i=0; i++; i<N){
printf("%d", A[i]);
}
printf("\n");
}
bubbleSort(A, N)
{
int j, flag;
flag = 1;
while {
flag = 0;
for (j=N-1; j--; 1<=j) {
if A[j] < A[j-1] {
A[j] = A[j-1];
flag = 1;
}
}
}
}
int main() {
int N, i, j;
int A[100];
scanf("%d", &N);
fo... | main.c: In function 'trace':
main.c:5:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
5 | printf("%d", A[i]);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 |
main.c:5:3: warning: incompatible impl... |
s649814513 | p02259 | C |
void trace(int A[], int N) {
int i;
for (i=0; i++; i<N){
printf("%d", A[i]);
}
printf("\n");
}
bubbleSort(A, N)
{
int j, flag;
flag = 1;
while(flag) {
flag = 0;
for (j=N-1; j--; 1<=j) {
if (A[j] < A[j-1]) {
A[j] = A[j-1];
flag = 1;
}
}
}
}
int main() {
int N, i, j;
int A[100];
scanf("%d", ... | main.c: In function 'trace':
main.c:5:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
5 | printf("%d", A[i]);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 |
main.c:5:3: warning: incompatible impl... |
s221566101 | p02259 | C | #include<stdio.h>
int main(void)
{
int N,i,j,v,n,a = 0;
int A[2000];
scanf("%d",&N);
n=N
for(i=0;i<N;i++)scanf("%d",A[i]);
for(i=N-1;i>0;i--){
j=i-1;
if(A[i]>A[j]){
v=A[i];
A[i]=A[j];
A[j]=v;
a++;
}
}
for(i=0;i<N;i++);{
if(i>0)printf(" ");
printf("%d",A[i]);
}
printf("\n");
printf("%d\n... | main.c: In function 'main':
main.c:7:12: error: expected ';' before 'for'
7 | n=N
| ^
| ;
8 | for(i=0;i<N;i++)scanf("%d",A[i]);
| ~~~
|
s155519954 | p02259 | C | #include<iostream>
using namespace std;
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;i>=i+1;j--){
if(A[j]<A[j-1]){
swap(A[j],A[j-1]);
flag=1;
sw++;
}
}
}
return sw;
}
int main(){
int A[100],N,sw;
cin>>N;
for(int i=0;i<N;i++)cin>>A[i... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s315213883 | p02259 | C | /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
| |
s322345228 | p02259 | C | #include <stdio.h>
int main(){
int n,i;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
while(flag=0){
flag=0;
for(j=0;j>n-1;j--){
if(A[i]<A[i-1]){
x=A[i];
y=A[i-1];
A[i]=y;
A[i-... | main.c: In function 'main':
main.c:10:11: error: 'flag' undeclared (first use in this function)
10 | while(flag=0){
| ^~~~
main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:13: error: 'j' undeclared (first use in this function)
12 | ... |
s541618489 | p02259 | C | #include <stdio.h>
int main(){
int n,i,j,flag;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
while(flag=0){
flag=0;
for(j=0;j>n-1;j--){
if(A[i]<A[i-1]){
x=A[i];
y=A[i-1];
A[i]=y;
... | main.c: In function 'main':
main.c:14:17: error: 'x' undeclared (first use in this function)
14 | x=A[i];
| ^
main.c:14:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:17: error: 'y' undeclared (first use in this function)
... |
s898911370 | p02259 | C | #include <stdio.h>
int main(){
int n,i,j,flag,x,y;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
while(flag=0){
flag=0;
for(j=0;j>n-1;j--){
if(A[i]<A[i-1]){
x=A[i];
y=A[i-1];
A[i]=y;
... | main.c: In function 'main':
main.c:25:21: error: expected ';' before 'return'
25 | printf("%d\n",j)
| ^
| ;
26 | return 0;
| ~~~~~~
|
s385926704 | p02259 | C | #include<stdio.h>
int main(){
int i,j,x,A[100],N,count =0,flag = 1 // 逆の隣接要素が存在する
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]){
x = A[j];
A[j] = A[j-1];
... | main.c: In function 'main':
main.c:6:4: error: expected ',' or ';' before 'scanf'
6 | scanf("%d",&N);
| ^~~~~
main.c:13:14: error: expected ';' before 'for'
13 | flag = 0
| ^
| ;
14 | for (j=N-1 ; j < 1 ; j++){
| ~~~
|
s348161682 | p02259 | C | /*
* File: main.c
* Author: s1252007
*
* Created on June 19, 2018, 10:55 AM
*/
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int bubbleSort(
int *a,
int n
);
int main(int argc, char** argv) {
int size, counter;
int *A;
scanf("%d", &size);
A = (int *)malloc(sizeof(int) * size... | /usr/bin/ld: /tmp/cc7is8Me.o: in function `main':
main.c:(.text+0xd2): undefined reference to `bubbleSort'
collect2: error: ld returned 1 exit status
|
s492127712 | p02259 | C | /*
* File: main.c
* Author: s1252007
*
* Created on June 19, 2018, 10:55 AM
*/
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int bubbleSort(
int *a,
int n
);
int main(int argc, char** argv) {
int size, counter;
int *A;
scanf("%d", &size);
A = (int *)malloc(sizeof(int) * size... | /usr/bin/ld: /tmp/ccO291Fw.o: in function `main':
main.c:(.text+0xd2): undefined reference to `bubbleSort'
collect2: error: ld returned 1 exit status
|
s915258770 | p02259 | C | #include<stdio.h>
int main(){
int i,j,x,A[100],N,count =0,flag = 1; // 逆の隣接要素が存在する
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]){
x = A[j];
A[j] = A[j-1];
... | main.c: In function 'main':
main.c:13:14: error: expected ';' before 'for'
13 | flag = 0
| ^
| ;
14 | for (j=N-1 ; j < 1 ; j++){
| ~~~
|
s575707629 | p02259 | C | int counter = 0;
| /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s713104337 | p02259 | C | /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
| |
s597166793 | p02259 | C | #include <stdio.h>
int main(){
int i,j,k=0,n,flag=1;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
while(flag=0){
flag=0;
for(i=n-1;i>1;i--){
if(A[i]<A[i-1]){
x=A[i];
y=A[i-1];
A[i]=y;
... | main.c: In function 'main':
main.c:15:17: error: 'x' undeclared (first use in this function)
15 | x=A[i];
| ^
main.c:15:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:17: error: 'y' undeclared (first use in this function)
... |
s844322034 | p02259 | C | #include <stdio.h>
int main(){
int i,j,k=0,n,flag=1;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
while(flag=0){
flag=0;
k++;
for(i=n-1;i>1;i--){
if(A[i]<A[i-1]){
x=A[i];
y=A[i-1];
... | main.c: In function 'main':
main.c:16:17: error: 'x' undeclared (first use in this function)
16 | x=A[i];
| ^
main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:17: error: 'y' undeclared (first use in this function)
... |
s304424039 | p02259 | C | #include <stdio.h>
int main(){
int i,j,k=0,n,flag=1;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
while(flag==0){
flag=0;
k++;
for(i=n-1;i>1;i--){
if(A[i]<A[i-1]){
x=A[i];
y=A[i-1];
... | main.c: In function 'main':
main.c:16:17: error: 'x' undeclared (first use in this function)
16 | x=A[i];
| ^
main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:17: error: 'y' undeclared (first use in this function)
... |
s233470515 | p02259 | C | /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
| |
s228947356 | p02259 | C | #include <stdio.h>
int main(){
int i,j,k=0,n,flag=1;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
while(flag==0){
flag=0;
k++;
for(i=n-1;i>1;i--){
if(A[i]<A[i-1]){
x=A[i];
y=A[i-1];
... | main.c: In function 'main':
main.c:16:17: error: 'x' undeclared (first use in this function)
16 | x=A[i];
| ^
main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:17: error: 'y' undeclared (first use in this function)
... |
s645807020 | p02259 | C | #include"stdio.h"
#include"stdlib.h"
int main()
{
int i,j;
int n;
int *A;
int buf;
int count=0;
scanf("%d",&n);
A=(int*)malloc(sizeof(int)*n);
for(i=0;i<n;i++)
{
scanf("%d",&Aa[i]);
}
for(i=0;i<n;i++)
{
for(j=n-1;j>i;j--)
{
if(A[j-1]... | main.c: In function 'main':
main.c:14:21: error: 'Aa' undeclared (first use in this function); did you mean 'A'?
14 | scanf("%d",&Aa[i]);
| ^~
| A
main.c:14:21: note: each undeclared identifier is reported only once for each function it appears in
|
s721328364 | p02259 | C | /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
| |
s178792856 | p02259 | C | #include <stdio.h>
int main(){
int i,j,k=0,n,flag=1,x,y;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
while(flag!=0){
flag=0;
for(i=n-1;i>=1;i--){
if(A[i]<A[i-1]){
x=A[i];
y=A[i-1];
A[i]... | main.c: In function 'main':
main.c:25:20: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
25 | if(i==n-1) print("%d",A[i]);
| ^~~~~
| printf
|
s002084206 | p02259 | C | /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
| |
s331515546 | p02259 | C | #include <stdio.h>
int x[100];
int main(){
int i;
int n;
int cnt = 0;
int flag;
int tempo;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&x[i]);
}
flag = 1;
while(flag){
flag = 0;
for(j=n-1;j>0;j--){
if(x[j] < x[j-1]){
tempo = x[j];
x[j] = x[j-1];
... | main.c: In function 'main':
main.c:20:11: error: 'j' undeclared (first use in this function)
20 | for(j=n-1;j>0;j--){
| ^
main.c:20:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:25: error: 'a' undeclared (first use in this function)
30 |... |
s864798132 | p02259 | C | #include <stdio.h>
int main(){
int n,i,j,flag,t,c=0;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
while(flag){
flag=0;
for(j=n-1;j>0;j--){
if(A[j]<A[j-1]){
t=A[j-1];
A[j-1]=A[j];
A[j]=t;
c++;
flag=1;
}
}
}
for(i=0;i<n;i++){
i... | main.c: In function 'main':
main.c:33:26: error: stray '\' in program
33 | if(i==n-1)printf("%d"\n,A[i]);
| ^
main.c:33:26: error: expected ')' before 'n'
33 | if(i==n-1)printf("%d"\n,A[i]);
| ~ ^~
| )
main.c:37:16:... |
s580330662 | p02259 | C | #include<stdio.h>
int main(){
int n,arr[100],i,j,temp,min,count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&arr[i]);
}
for(i=0;i<n-1;i++){
min=i+1;
for(j=i+1;j<n;j++){
if(arr[j]<arr[min]){
min=j;
}
}
if(arr[min]<arr[i]){
temp=arr[i];
arr[i]=arr[min];
... | main.c: In function 'main':
main.c:31:25: error: expected ';' before 'return'
31 | printf("%d\n",count*3)
| ^
| ;
32 | return 0;
| ~~~~~~
|
s174078362 | p02259 | C | #include<stdio.h>
int main(){
int n,arr[100],i,j,temp,min,count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&arr[i]);
}
for(i=0;i<n-1;i++){
min=i+1;
for(j=i+1;j<n;j++){
if(arr[j]<arr[min]){
min=j;
}
}
if(arr[min]<arr[i]){
temp=arr[i];
arr[i]=arr[min];
... | main.c: In function 'main':
main.c:31:23: error: expected ';' before 'return'
31 | printf("%d\n",count)
| ^
| ;
32 | return 0;
| ~~~~~~
|
s508151073 | p02259 | C | /home/student/s1250137/Algo/Ex02/ex2_A.c
| main.c:1:1: error: expected identifier or '(' before '/' token
1 | /home/student/s1250137/Algo/Ex02/ex2_A.c
| ^
|
s127736898 | p02259 | C | /home/student/s1250137/Algo/Ex02/ex2_A.c
| main.c:1:1: error: expected identifier or '(' before '/' token
1 | /home/student/s1250137/Algo/Ex02/ex2_A.c
| ^
|
s568099716 | p02259 | C | /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
| |
s986212428 | p02259 | C | /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
| |
s862654295 | p02259 | C | /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
| |
s274214796 | p02259 | C | /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
| |
s560874180 | p02259 | C | /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
| |
s071342420 | p02259 | C | #include<stdio.h>
int main()
{
int A[100],N;
int i,j,temp,c=0;
scanf("%d\n",&N);
for(i = 0; i < N; i++){
scanf("%d",&A[i]);
}
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;
c++;
}
... | main.c: In function 'main':
main.c:26:22: error: expected ')' before 'A'
26 | else printf("%d "A[i]);
| ~ ^
| )
|
s441300528 | p02259 | C | /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
| |
s930741564 | p02259 | C | /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
| |
s468496867 | p02259 | C | #include<stdio.h>
#define SWAP(a,b) (a += b,b = a - b,a -= b)
int main(){
int flag=1;
int N;
int i,j,b=0;;
scanf("%d",&N);
int A[N];
for(i=0;i<N;i++){
scanf("%d",&A[i]);
}
while(flag){
flag=0;
for(j=N-1;j>0;j--){
if(A[j]<A[j-1]){
SWAP(A[j],A[j-1]);
b++;
flag=1;
}
}
}
... | main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
33 | }
| ^
|
s150709321 | p02259 | C | #include<stdio.h>
#define SWAP(a,b) (a += b,b = a - b,a -= b)
int main(){
int flag=1;
int N;
int i,j,b=0;;
scanf("%d",&N);
int A[N];
for(i=0;i<N;i++){
scanf("%d",&A[i]);
}
while(flag){
flag=0;
for(j=N-1;j>0;j--){
if(A[j]<A[j-1]){
SWAP(A[j],A[j-1]);
b++;
flag=1;
}
}
}
... | main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
33 | }
| ^
|
s497555170 | p02259 | C | /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
| |
s704254479 | p02259 | C | /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
| |
s036385304 | p02259 | C | /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
| |
s662154682 | p02259 | C | #include<stdio.h>
#include<stdlib.h>
#define NMIN 1
#define NMAX 100
#define AMIN 0
#define AMAX 100
int main(){
int N,A[NMAX],i,flag=1,subA,cnt=0;
scanf("%d",&N);
if(N<NMIN||N>NMAX) exit(1);
for(i=0;i<N;i++){
scanf("%d",&A[i]);
if(A[i]<AMIN||A[i]>AMAX) exit(1);
}
while(flag){
flag=0;
fo... | main.c: In function 'main':
main.c:19:11: error: 'n' undeclared (first use in this function)
19 | for(i=n-1;i>=1;i--){
| ^
main.c:19:11: note: each undeclared identifier is reported only once for each function it appears in
|
s449003543 | p02259 | C | #include<stdio.h>
#include<stdlib.h>
#define NMIN 1
#define NMAX 100
#define AMIN 0
#define AMAX 100
int main(){
int N,A[NMAX],i,flag=1,subA,cnt=0;
scanf("%d",&N);
if(N<NMIN||N>NMAX) exit(1);
for(i=0;i<N;i++){
scanf("%d",&A[i]);
if(A[i]<AMIN||A[i]>AMAX) exit(1);
}
while(flag){
flag=0;
fo... | main.c: In function 'main':
main.c:19:11: error: 'n' undeclared (first use in this function)
19 | for(i=n-1;i>=1;i--){
| ^
main.c:19:11: note: each undeclared identifier is reported only once for each function it appears in
|
s084427956 | p02259 | C | /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
| |
s258912140 | p02259 | C | /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
| |
s747036821 | p02259 | C | #include<stdio.h>
int bubbleSort(A[],n){
int flag,c=0,j,tmp;
flag=1;
while(flag){
flag=0;
for(j=n-1;j>0;j--){
if(A[j]<A[j-1]){
tmp=A[j];
A[j]=A[j-1];
A[j-1]=tmp;
flag=1;
c++;
}
}
}
return c;
}
int main(){
int i,n,A[100],j,c;
scanf("%d",&... | main.c:2:16: error: unknown type name 'A'
2 | int bubbleSort(A[],n){
| ^
main.c:2:20: error: unknown type name 'n'
2 | int bubbleSort(A[],n){
| ^
main.c: In function 'main':
main.c:27:13: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-decl... |
s450174269 | p02259 | C | /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
| |
s656631053 | p02259 | C | /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
| |
s383603711 | p02259 | C | /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
| |
s727174643 | p02259 | C | #include<stdio.h>
int main(){
int ,j,N,count,ch,flag;
int a[100];
count=0;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&a[i]);
}
flag=1;
while(flag){
flag=0;
for(j=N-1;j>=1;j--){
if(a[j]<a[j-1]){
ch=a[j-1];
a[j-1]=a[j];
a[j]=ch;
count++;
flag=1;
}
}
}
for(j=0... | main.c: In function 'main':
main.c:3:7: error: expected identifier or '(' before ',' token
3 | int ,j,N,count,ch,flag;
| ^
main.c:5:3: error: 'count' undeclared (first use in this function)
5 | count=0;
| ^~~~~
main.c:5:3: note: each undeclared identifier is reported only once for each f... |
s859609728 | p02259 | C | #include<stdio.h>
int main(){
int ,j,N,count,ch,flag;
int a[100];
count=0;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&a[i]);
}
flag=1;
while(flag){
flag=0;
for(j=N-1;j>=1;j--){
if(a[j]<a[j-1]){
ch=a[j-1];
a[j-1]=a[j];
a[j]=ch;
count++;
flag=1;
}
}
}
for(j=0... | main.c: In function 'main':
main.c:3:7: error: expected identifier or '(' before ',' token
3 | int ,j,N,count,ch,flag;
| ^
main.c:5:3: error: 'count' undeclared (first use in this function)
5 | count=0;
| ^~~~~
main.c:5:3: note: each undeclared identifier is reported only once for each f... |
s350168031 | p02259 | C | #include<iostream>
using namespace std;
int bubbleSort(int A[],int N){
int s=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;
s++;
}
}
}
return s;
}
int main(){
int A[100],N,s;
cin>>N... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s614185302 | p02259 | C | /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
| |
s749407057 | p02259 | C | /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
| |
s991646395 | p02259 | C | /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
| |
s122725513 | p02259 | C | #include<stdio.h>
int BubbleSort(int A[],int N){
int i,j,count=0,tmp;
for(i = 0 ; i < N-1 ; i++){
for(j = N-1 ; j >= 1 ; j--){
if(A[j] < A[j - 1]){
tmp = A[j];
A[j] = A[j - 1];
A[j - 1] = tmp;
count++;
}
}
}
return count;
}
int main(){
int N,i,count;
scanf("%d",&N);
int A... | main.c: In function 'main':
main.c:33:3: error: implicit declaration of function 'prinbt'; did you mean 'printf'? [-Wimplicit-function-declaration]
33 | prinbt("%d",A[0]);
| ^~~~~~
| printf
|
s595387816 | p02259 | C | #include<stdio.h>
int BubbleSort(int A[],int N){
int i,j,count=0,tmp;
for(i = 0 ; i < N-1 ; i++){
for(j = N-1 ; j >= 1 ; j--){
if(A[j] < A[j - 1]){
tmp = A[j];
A[j] = A[j - 1];
A[j - 1] = tmp;
count++;
}
}
}
return count;
}
int main(){
int N,i,count;
scanf("%d",&N);
int A... | main.c: In function 'main':
main.c:33:3: error: implicit declaration of function 'prinbt'; did you mean 'printf'? [-Wimplicit-function-declaration]
33 | prinbt("%d",A[0]);
| ^~~~~~
| printf
|
s351668071 | p02259 | C | #include<stdio.h>
int BubbleSort(int A[],int N){
int i,j,count=0,tmp;
for(i = 0 ; i < N-1 ; i++){
for(j = N-1 ; j >= 1 ; j--){
if(A[j] < A[j - 1]){
tmp = A[j];
A[j] = A[j - 1];
A[j - 1] = tmp;
count++;
}
}
}
return count;
}
int main(){
int N,i,count;
scanf("%d",&N);
int A... | main.c: In function 'main':
main.c:33:3: error: implicit declaration of function 'prinbt'; did you mean 'printf'? [-Wimplicit-function-declaration]
33 | prinbt("%d",A[0]);
| ^~~~~~
| printf
|
s048418114 | p02259 | C | #include<stdio.h>
int main(){
int flag,i,j,count=0,n;
scanf("%d",&n);
int A[n];
for(i=0;i<n;i++)
scanf("%d",&A[i]);
flag = 1;
while (flag){
flag = 0;
for(j=n-1;j>1;j--){
if (A[j] < A[j-1]){
count++;
key = A[j];
A[j] = A[j-1];
A[j-1] = key;
}
}
... | main.c: In function 'main':
main.c:14:8: error: 'key' undeclared (first use in this function)
14 | key = A[j];
| ^~~
main.c:14:8: note: each undeclared identifier is reported only once for each function it appears in
|
s936636476 | p02259 | C | /home/student/s1250137/Algo/Ex02/ex2_A.c
| main.c:1:1: error: expected identifier or '(' before '/' token
1 | /home/student/s1250137/Algo/Ex02/ex2_A.c
| ^
|
s095168041 | p02259 | C | /home/student/s1250137/Algo/Ex02/ex2_A.c
| main.c:1:1: error: expected identifier or '(' before '/' token
1 | /home/student/s1250137/Algo/Ex02/ex2_A.c
| ^
|
s201380990 | p02259 | C | #include<stdio.h>
int main(){
int i,j,frag = 1,n,A[100],tmp,count = 0;
scanf("%d",&n);
for(i = 0 ; i < n ; i++){
scanf("%d",&A[i]);
}
while(frag != 0){
frag = 0;
for(j = n - 1 ; j > 0 ; j--){
if(A[j] < A[j - 1]){
tmp = A[j];
A[j] = A[j - 1];
A[j - 1] = tmp;
frag = 1;
count += 1;
}... | main.c: In function 'main':
main.c:21:13: error: 'k' undeclared (first use in this function)
21 | if(i == k - 1)printf("%d",A[i]);
| ^
main.c:21:13: note: each undeclared identifier is reported only once for each function it appears in
|
s383498908 | p02259 | C |
#include<stdio.h>
void output(int A[], int n){
int i;
for(i =0;i<n;i++){
if(i > 0) && i < x{
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[... | main.c: In function 'output':
main.c:8:23: error: 'x' undeclared (first use in this function)
8 | if(i > 0) && i < x{
| ^
main.c:8:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:24: error: expected ';' before '{' token
8 | ... |
s202080626 | p02259 | C | /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
| |
s309687654 | p02259 | C | /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
| |
s076633464 | p02259 | C | /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
| |
s268032949 | p02259 | C | /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
| |
s447304369 | p02259 | C | /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
| |
s569473039 | p02259 | C | /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
| |
s433629073 | p02259 | C | /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
| |
s796697549 | p02259 | C | /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
| |
s780823676 | p02259 | C | /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
| |
s139621073 | p02259 | C | /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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.