submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s828337746 | p02261 | 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
| |
s724117628 | p02261 | C | #include<stdio.h>
struct card
{
char num[2];
char mark;
int value;
};
int n;
char isStable(struct card in[], struct card out[])
{
for(i = 0; i < n; i++)
{
if(b[i].value != c[i].value)
{
return 0;
}
}
return 1;
}
int main()
{
int i, j, minj, k;
struct card c[36], a[36], b[36], tmp;
sca... | main.c: In function 'isStable':
main.c:11:7: error: 'i' undeclared (first use in this function); did you mean 'in'?
11 | for(i = 0; i < n; i++)
| ^
| in
main.c:11:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:10: error: 'b' undeclared (f... |
s226727397 | p02261 | C | #include<stdio.h>
struct card
{
char num[2];
char mark;
int value;
};
int n;
char isStable(struct card in[], struct card out[])
{
i = 0;
for(i = 0; i < n; i++)
{
if(in[i].value != out[i].value)
{
return 0;
}
}
return 1;
}
int main()
{
int i, j, minj, k;
struct card c[36], a[36], b[36]... | main.c: In function 'isStable':
main.c:11:3: error: 'i' undeclared (first use in this function); did you mean 'in'?
11 | i = 0;
| ^
| in
main.c:11:3: note: each undeclared identifier is reported only once for each function it appears in
|
s432407882 | p02261 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 36
void BubbleSort();
void SelectionSort();
char A[MAX][2],BS[MAX][2],SS[MAX][2];
int count=0,n;
int main(){
int i;
scanf("%d",&n);
for( i = 0; i < n; i++) scanf(" %s%d",A[i][0],A[i][1]);
BubbleSort();
for( i = 0; i < n; i++) pri... | main.c: In function 'BubbleSort':
main.c:38:39: error: assignment to expression with array type
38 | BS[j] = A[j-1];
| ^
main.c:39:41: error: assignment to expression with array type
39 | BS[j-1] = A[j];
... |
s479455514 | p02261 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 36
void BubbleSort();
void SelectionSort();
char A[MAX][2],BS[MAX][2],SS[MAX][2];
int count=0,n;
int main(){
int i;
scanf("%d",&n);
for( i = 0; i < n; i++) scanf(" %s%d",A[i][0],A[i][1]);
BubbleSort();
for( i = 0; i < n; i++) pri... | main.c: In function 'BubbleSort':
main.c:38:39: error: assignment to expression with array type
38 | BS[j] = A[j-1];
| ^
main.c:39:41: error: assignment to expression with array type
39 | BS[j-1] = A[j];
... |
s231825704 | p02261 | C | #include<stdio.h>
char card[36][2];
int number;
void bubble(){
int i;
for(i=0;i<number;i++){
printf("%s ", );
printf("\n");}
}
void selection(){
}
int main(){
int i;
scanf("%d",&number);
for(i=0;i<number;i++){
scanf("%s",card[i]);
}
bubble();
select... | main.c: In function 'bubble':
main.c:14:21: error: expected expression before ')' token
14 | printf("%s ", );
| ^
|
s481244963 | p02261 | C | #include<iostream>
using namespace std;
struct Card {char suit, value;};
void bubbleSort(struct Card A[], int N) {
for (int i=0; i<N; i++) {
for (int j=N-1; j>=i+1; j--) {
if (A[j-1].value > A[j].value) {
Card t = A[j-1]; A[j-1] = A[j]; A[j] = t;
}
}
}
}
void selectionSort(struct Card... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s730429881 | p02261 | C | #include<stdio.h>
struct card{
char gara[37];
int kazu[37];
};
struct card card1;
struct card card2;
void bublle(struct card1,int n){
int i,j,tmp,tmp2;
for(i=0;i<n;i++){
for(j=n;j>i;j--){
... | main.c:11:21: warning: 'struct card1' declared inside parameter list will not be visible outside of this definition or declaration
11 | void bublle(struct card1,int n){
| ^~~~~
main.c:11:14: error: parameter 1 has incomplete type
11 | void bublle(struct card1,int n){
| ... |
s212215106 | p02261 | C | #include<stdio.h>
struct card{
char gara[37];
int kazu[37];
};
struct card card1;
struct card card2;
void bublle(struct card1.gara[],struct card1.kazu[],int n){
int i,j,tmp,tmp2;
for(i=0;i<n;i++){
for(j=n;j>i;j--){
... | main.c:11:26: error: expected ';', ',' or ')' before '.' token
11 | void bublle(struct card1.gara[],struct card1.kazu[],int n){
| ^
main.c:28:26: error: expected ';', ',' or ')' before '.' token
28 | void select(struct card2.gara[],struct card2.kazu[],int n){
| ... |
s113666592 | p02261 | C | #include<stdio.h>
struct card{
char gara;
int kazu;
};
struct card card1[37];
struct card card2[37];
void bublle(struct card card1[],int n){
int i,j;
struct card t;
for(i=0;i<n;i++){
for(j=n;j>i;j--){
... | main.c: In function 'bublle':
main.c:17:52: error: 'tmp' undeclared (first use in this function)
17 | tmp=card1[j-1].kazu;
| ^~~
main.c:17:52: note: each undeclared identifier is reported only once for each fu... |
s188594313 | p02261 | C | #include<stdio.h>
struct card{
char gara;
int kazu;
};
struct card card1[37];
struct card card2[37];
void bublle(struct card card1[],int n){
int i,j;
struct card t;
for(i=0;i<n;i++){
for(j=n;j>i;j--){
... | main.c: In function 'bublle':
main.c:17:52: error: 'tmp' undeclared (first use in this function)
17 | tmp=card1[j-1].kazu;
| ^~~
main.c:17:52: note: each undeclared identifier is reported only once for each fu... |
s436696713 | p02261 | C | #include<stdio.h>
struct card{
char gara;
int kazu;
};
struct card card1[37];
struct card card2[37];
void bublle(struct card card1[],int n){
int i,j;
struct card t;
for(i=0;i<n;i++){
for(j=n;j>i;j--){
... | main.c: In function 'bublle':
main.c:17:52: error: 'tmp' undeclared (first use in this function)
17 | tmp=card1[j-1].kazu;
| ^~~
main.c:17:52: note: each undeclared identifier is reported only once for each fu... |
s118905783 | p02261 | C | #include<stdio.h>
struct card{
char gara;
int kazu;
};
struct card card1[37];
struct card card2[37];
void bublle(struct card card1[],int n){
int i,j;
struct card t;
for(i=0;i<n;i++){
for(j=n;j>i;j--){
... | main.c: In function 'bublle':
main.c:17:54: error: incompatible types when assigning to type 'struct card' from type 'int'
17 | t=card1[j-1].kazu;
| ^~~~~
main.c:19:66: error: incompatible types when assigni... |
s061812977 | p02261 | C | #include<stdio.h>
struct card{
char gara;
int kazu;
};
struct card card1[37];
struct card card2[37];
void bublle(struct card card1[],int n){
int i,j;
card t;
for(i=0;i<n;i++){
for(j=n;j>i;j--){
... | main.c: In function 'bublle':
main.c:13:16: error: unknown type name 'card'; use 'struct' keyword to refer to the type
13 | card t;
| ^~~~
| struct
main.c:23:23: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
23 | ... |
s775592432 | p02261 | C | #include<stdio.h>
struct card{
char gara;
int kazu;
};
card card1[37];
card card2[37];
void bublle(struct card card1[],int n){
int i,j;
card t;
for(i=0;i<n;i++){
for(j=n;j>i;j--){
... | main.c:8:2: error: unknown type name 'card'; use 'struct' keyword to refer to the type
8 | card card1[37];
| ^~~~
| struct
main.c:9:2: error: unknown type name 'card'; use 'struct' keyword to refer to the type
9 | card card2[37];
| ^~~~
| struct
main.c: In function 'bublle':
main... |
s577694198 | p02261 | C | #include<stdio.h>
struct card{
char gara;
char kazu;
};
struct card card1[37];
struct card card2[37];
void bublle(struct card card1[],int n){
int i,j;
struct card t;
for(i=0;i<n;i++){
for(j=n;j>i;j--){
... | main.c: In function 'bublle':
main.c:23:23: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
23 | return 0;
| ^
main.c:11:7: note: declared here
11 | void bublle(struct card card1[],int n){
| ^~~~~~
main.c: In function 'select':
m... |
s703007930 | p02261 | C | #include <stdio.h>
int main(void){
int N, i, j, k, x, m, h, y, minj, g1, g2;
scanf("%d", &N);
int A[N], B[N], C1[N], C2[N], D1[N], D2[N], K1[N], K2[N], L1[N], L2[N];
for(i = 0; i < N; i++) {
scanf("%d%d", &B[i], &A[i]);
}
for(i = 0; i < N; i++) {
C1[N] = A[N];
C2[N] = B[N];
}
... | main.c: In function 'main':
main.c:87:1: error: expected declaration or statement at end of input
87 | }
| ^
|
s019317912 | p02261 | C | #include <stdio.h>
int main(void){
int N, i, j, k, x, m, h, y, minj, g1, g2;
scanf("%d", &N);
int A[N], B[N], C1[N], C2[N], D1[N], D2[N], K1[N], K2[N], L1[N], L2[N];
for(i = 0; i < N; i++) {
scanf("%d%d", &B[i], &A[i]);
}
for(i = 0; i < N; i++) {
C1[N] = A[N];
C2[N] = B[N];
}
... | main.c: In function 'main':
main.c:87:1: error: expected declaration or statement at end of input
87 | }
| ^
|
s954222423 | p02261 | C | #include <stdio.h>
int main(void){
int N, i, j, k, x, m, h, y, minj, g1, g2;
scanf("%d", &N);
int A[N], B[N], C1[N], C2[N], D1[N], D2[N], K1[N], K2[N], L1[N], L2[N];
for(i = 0; i < N; i++) {
scanf("%d%d", &A[i]);
}
for(i = 0; i < N; i++) {
C1[N] = A[N];
}
for(i = 0; i < N; i++) ... | main.c: In function 'main':
main.c:23:19: error: request for member 'value' in something not a structure or union
23 | if (C1[j].value < C1[j - 1].value) {
| ^
main.c:23:37: error: request for member 'value' in something not a structure or union
23 | if (C1[j].value < C1[... |
s639210822 | p02261 | C | #include <stdio.h>
int main(void){
int N, i, j, k, x, m, h, y, minj, g1, g2;
scanf("%d", &N);
int A[N], B[N], C1[N], C2[N], D1[N], D2[N], K1[N], K2[N], L1[N], L2[N];
for(i = 0; i < N; i++) {
scanf("%d", &A[i]);
}
for(i = 0; i < N; i++) {
C1[N] = A[N];
}
for(i = 0; i < N; i++) {
... | main.c: In function 'main':
main.c:23:19: error: request for member 'value' in something not a structure or union
23 | if (C1[j].value < C1[j - 1].value) {
| ^
main.c:23:37: error: request for member 'value' in something not a structure or union
23 | if (C1[j].value < C1[... |
s735652804 | p02261 | 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
| |
s484889576 | p02261 | C | #include <stdio.h>
#include <string.h>
#define N 36
typedef struct {
char mark;
int value;
}Card;
void BubbleSort(Card *, int);
void SelectionSort(Card *, int);
void disply(Card *, int);
int isStable(Card *, Card *, int);
int main(){
Card C1[M+1], C2[M+1];
int i, N;
scanf("%d",&N);
//文字列と数字をそれぞれ格納
for(... | main.c: In function 'main':
main.c:16:11: error: 'M' undeclared (first use in this function)
16 | Card C1[M+1], C2[M+1];
| ^
main.c:16:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:11: error: expected identifier or '(' before numeric constant
... |
s641392072 | p02261 | C | #include <stdio.h>
int partition(int *,int,int)
int main(){
int i,j;
return 0;
}
int partition(int A[],int p,int r){
int tmp;
int x=A[r];
i = p-1;
for(j=p;j<=r-1;j++){
if(A[j]<=x){
i++;
tmp =A[j];
A[j]=A[i];
A[i]=tmp;
}
} tmp =A[i+1];
A[i+1]=A[r];
A[r]=tmp;
retur... | main.c: In function 'partition':
main.c:5:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
5 | int main(){
| ^
main.c:10:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
10 | int partition(int A[],int p,int r){
| ... |
s440026228 | p02261 | 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
| |
s961913150 | p02261 | C | #include <stdio.h>
//1 行目 バブルソート
//2 安定かどうか
//3 選択ソート
//4 安定かどうか
struct typedef{
char mark;
int nmber;
int mark_number;
} card;
void bubblesort(card *);
void selectionsort(card*);
int main(){
card A[36];
int i,j,n;
scanf("%d",&n);
for(i=-0;i<36;i++){
scanf("%c%d",A[i].mark,&A[i].number);
... | main.c:7:8: error: expected '{' before 'typedef'
7 | struct typedef{
| ^~~~~~~
main.c:11:3: warning: data definition has no type or storage class
11 | } card;
| ^~~~
main.c:11:3: error: type defaults to 'int' in declaration of 'card' [-Wimplicit-int]
main.c:13:17: error: expected declaration... |
s088356959 | p02261 | C | #include<stdio.h>
#include<stdlib.h>
struct CARD
{
char suit;
int value;
};
int main(){
int n,i,j,minj,flag=0,t;
struct CARD c[36],c2[36],cr,vr;
char k;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf(" %c%c",&c[i].suit,&k);
c[i].value=atoi(&k);
}
for(i=0; i<n; i++){
c2[i]=c[i];
}
//Bub... | main.c: In function 'main':
main.c:82:3: error: expected declaration or statement at end of input
82 | return 0;
| ^~~~~~
|
s293252219 | p02261 | C | #include<stdio.h>
#include<stdlib.h>
struct CARD
{
char suit;
int value;
};
int main(){
int n,i,j,minj,flag=0,t;
struct CARD c[36],c2[36],cr,vr;
char k;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf(" %c%c",&c[i].suit,&k);
c[i].value=atoi(&k);
}
for(i=0; i<n; i++){
c2[i]=c[i];
}
//Bub... | main.c: In function 'main':
main.c:82:3: error: expected declaration or statement at end of input
82 | return 0;
| ^~~~~~
|
s647498847 | p02261 | 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
| |
s498416497 | p02261 | C | #include<stdio.h>
struct card
{
char suit;
char value;
};
void BubbleSort(struct card A[],int n)
{
int i,j;
struct card t;
for( i = 0;i< n;i++)
{
for (j = n-1;j>=i+1;j--)
{
if (A[j].value < A[j-1].value)
{
t=A[j];
A[j]=A[j-1];
A[j-1]=t;
}
}
}
}
void selecti... | main.c: In function 'main':
main.c:88:3: error: implicit declaration of function 'bubble' [-Wimplicit-function-declaration]
88 | bubble(c1,n);
| ^~~~~~
|
s351155837 | p02261 | 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
| |
s667879556 | p02261 | 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
| |
s231287272 | p02261 | 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
| |
s820927543 | p02261 | 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
| |
s861145765 | p02261 | 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
| |
s804884027 | p02261 | 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
| |
s108625442 | p02261 | 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
| |
s663811163 | p02261 | 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
| |
s670654256 | p02261 | 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
| |
s576206476 | p02261 | 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
| |
s402895231 | p02261 | C | #include <stdio.h>
#include <stdlib.h>
typedef struct {
char suit;
int value;
}AAA;
void BubbleSort(AAA *, int);
void SelectionSort(AAA *, int);
void output(AAA *, int);
main main(){
int N, i;
AAA *C, *C_B, *C_S;
scanf("%d",&N);
C = malloc(sizeof(AAA) * N);
C_B = malloc(sizeof(AAA) * N);
C_S = mal... | main.c:13:1: error: unknown type name 'main'
13 | main main(){
| ^~~~
|
s967731865 | p02261 | 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
| |
s956001642 | p02261 | C | #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
struct card {
char suit;
int value;
};
void bubbleSort(card A[], const int N)
{
int flag = 1;
for( int i = 0; flag; ++i ){
flag = 0;
for( int j = N-1; i < j; --j )
if( A[j].value < A[j-1].value ... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s540304572 | p02261 | C | #include <stdio.h>
#include <string.h>
#include <ctype.h>
struct card{
char suit;
int value;
};
typedef struct card card;
void print_array(card a[], int length)
{
for(int i=0; i<length; i++){
if(i==length-1)
printf("%c%d\n", a[i].suit, a[i].value);
else
printf("%c%d... | main.c: In function 'bubble_sort':
main.c:36:17: error: 'swap_num' undeclared (first use in this function)
36 | swap_num++;
| ^~~~~~~~
main.c:36:17: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'selection_sort':
main.... |
s812928446 | p02261 | C | /*
問題をよく読もう!
論理的に考えよう!
サンプルを確認しよう!
絶対に諦めるな!
工夫をしろ!
配列は少し多めにとっておく
Twitterは終わるまでログアウト!
(間違えて解法をツイートしてはいけないから)
*/
//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#includ... | main.c:14:9: fatal error: iostream: No such file or directory
14 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s832525141 | p02261 | C | #include<stdio.h>
//構造体の定義
typedef struct {
char suit[10];
int value;
} Card ;
//バブルソート
void BubbleSort(Card A[], int N) {
int i, j;
Card temp;
for (i = 0; i < N; i++) {
for (j = N - 1; j >= i + 1; j--) {
if (A[j].value < A[j - 1].value) {
temp = A[j];
A[j] = A[j - 1];
A[j - 1] = temp;
}
}... | main.c:45:1: error: unknown type name 'bool'
45 | bool isStable(Card BC[], Card SC[], int N) {
| ^~~~
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: In function 'isSta... |
s758844827 | p02261 | C | #include<stdio.h>
//構造体の定義
typedef struct {
char suit[10];
int value;
} Card ;
//バブルソート
void BubbleSort(Card A[], int N) {
int i, j;
Card temp;
for (i = 0; i < N; i++) {
for (j = N - 1; j >= i + 1; j--) {
if (A[j].value < A[j - 1].value) {
temp = A[j];
A[j] = A[j - 1];
A[j - 1] = temp;
}
}... | main.c:45:1: error: unknown type name 'bool'
45 | bool isStable(Card BC[], Card SC[], int N) {
| ^~~~
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: In function 'isSta... |
s505142111 | p02261 | C | #include<stdio.h>
//構造体の定義
typedef struct {
char suit[10];
int value;
} Card ;
//バブルソート
void BubbleSort(Card A[], int N) {
int i, j;
Card temp;
for (i = 0; i < N; i++) {
for (j = N - 1; j >= i + 1; j--) {
if (A[j].value < A[j - 1].value) {
temp = A[j];
A[j] = A[j - 1];
A[j - 1] = temp;
}
}... | main.c: In function 'main':
main.c:68:22: error: '(Card *)&C' is a pointer; did you mean to use '->'?
68 | scanf("%s", C.suit);
| ^
| ->
main.c:69:24: error: '(Card *)&C' is a pointer; did you mean to use '->'?
69 | scanf("%d ", &C.value);
... |
s223580625 | p02261 | C | #include<stdio.h>
/*構造体の定義*/
typedef struct {
char suit[10];
int value;
} Card ;
void swap_Card(Card *x, Card *y)
{
Card temp = *x;
*x = *y;
*y = temp;
}
/*バブルソート*/
void BubbleSort(Card A[], int N) {
int i, j;
for (i = 0; i < N - 1; i++) {
for (j = N - 1; j >= i; j--) {
if (A[j].value < A[j - 1].value)... | main.c: In function 'main':
main.c:67:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
67 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s770180408 | p02261 | C | #include<stdio.h>
/*構造体の定義*/
typedef struct {
char suit[10];
int value;
} Card ;
void swap_Card(Card *x, Card *y)
{
Card temp = *x;
*x = *y;
*y = temp;
}
/*バブルソート*/
void BubbleSort(Card A[], int N) {
int i, j;
for (i = 0; i < N - 1; i++) {
for (j = N - 1; j >= i; j--) {
if (A[j].value < A[j - 1].value)... | main.c: In function 'main':
main.c:63:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
63 | scanf_s("%d\n", &N);
| ^~~~~~~
| scanf
|
s119215442 | p02261 | C | #include<stdio.h>
/*構造体の定義*/
typedef struct {
char suit;
int value;
} Card ;
void swap_Card(Card *x, Card *y)
{
Card temp = *x;
*x = *y;
*y = temp;
}
/*バブルソート*/
void BubbleSort(Card A[], int N) {
int i, j;
for (i = 0; i < N - 1; i++) {
for (j = N - 1; j >= i; j--) {
if (A[j].value < A[j - 1].value) {
... | main.c: In function 'main':
main.c:77:34: error: 'min_i' undeclared (first use in this function)
77 | if (SC[j].value < SC[min_i].value)
| ^~~~~
main.c:77:34: note: each undeclared identifier is reported only once for each function it appears in
|
s771860630 | p02261 | C | #include<stdio.h>
/*構造体の定義*/
typedef struct {
char suit;
int value;
} Card ;
void swap_Card(Card *x, Card *y)
{
Card temp = *x;
*x = *y;
*y = temp;
}
//バブルソート
void BubbleSort(Card A[], int N) {
int i, j;
Card temp;
for (i = 0; i < N-1; i++) {
for (j = N - 1; j > i ; j--) {
if (A[j].value < A[j - 1].v... | main.c: In function 'BubbleSort':
main.c:27:42: error: 'minj' undeclared (first use in this function)
27 | A[i] = A[minj];
| ^~~~
main.c:27:42: note: each undeclared identifier is reported only once for each function it appears in
|
s835798272 | p02261 | C | #include<stdio.h>
/*構造体の定義*/
typedef struct {
char suit;
int value;
} Card ;
void BubbleSort(Card A[], int N) {
int i, j;
Card temp;
for (i = 0; i < N; i++) {
for (j = N - 1; j >= i + 1; j--) {
if (A[j].value < A[j - 1].value) {
temp = A[j];
A[j] = A[j - 1];
A[j - 1] = temp;
}
}
}
}
vo... | main.c: In function 'main':
main.c:67:30: error: 'c' undeclared (first use in this function)
67 | scanf("%c", &c.suit);
| ^
main.c:67:30: note: each undeclared identifier is reported only once for each function it appears in
|
s222080035 | p02261 | C | #include<stdio.h>
/*構造体の定義*/
typedef struct {
char suit;
int value;
} Card ;
void BubbleSort(Card A[], int N) {
int i, j;
Card temp;
for (i = 0; i < N; i++) {
for (j = N - 1; j >= i + 1; j--) {
if (A[j].value < A[j - 1].value) {
temp = A[j];
A[j] = A[j - 1];
A[j - 1] = temp;
}
}
}
}
vo... | main.c: In function 'main':
main.c:67:32: error: '(Card *)&BC' is a pointer; did you mean to use '->'?
67 | scanf("%c", &BC.suit);
| ^
| ->
|
s861762525 | p02261 | C | #include<stdio.h>
/*構造体の定義*/
typedef struct {
char suit;
int value;
} Card ;
void BubbleSort(Card A[], int N) {
int i, j;
Card temp;
for (i = 0; i < N; i++) {
for (j = N - 1; j >= i + 1; j--) {
if (A[j].value < A[j - 1].value) {
temp = A[j];
A[j] = A[j - 1];
A[j - 1] = temp;
}
}
}
}
vo... | main.c:44:1: error: unknown type name 'bool'
44 | bool isStable(Card BC[], Card SC[], int N) {
| ^~~~
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: In function 'isSta... |
s709311653 | p02261 | C | #include<stdio.h>
/*構造体の定義*/
typedef struct {
char suit;
int value;
} Card ;
void BubbleSort(Card A[], int N) {
int i, j;
Card temp;
for (i = 0; i < N; i++) {
for (j = N - 1; j >= i + 1; j--) {
if (A[j].value < A[j - 1].value) {
temp = A[j];
A[j] = A[j - 1];
A[j - 1] = temp;
}
}
}
}
vo... | main.c: In function 'isStable':
main.c:50:32: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
50 | return 0;
| ^
main.c:44:6: note: declared here
44 | void isStable(Card BC[], Card SC[], int N) {
| ^~~~~~~~
main.c... |
s924115451 | p02261 | C | #include <stdio.h>
struct Card {char suit; int value;};
void printStructArray(struct Card var[], int num) {
int i;
for (i = 0; i < num; i++) {
if (i > 0) printf(" ");
printf("%c%d", var[i].suit, var[i].value);
}
printf("\n");
}
void bubbleSort(struct Card var[], int num) {
int i, j;
Card tmp;... | main.c: In function 'bubbleSort':
main.c:16:3: error: unknown type name 'Card'; use 'struct' keyword to refer to the type
16 | Card tmp;
| ^~~~
| struct
main.c:21:19: error: incompatible types when assigning to type 'int' from type 'struct Card'
21 | tmp = var[j];
| ... |
s654475843 | p02261 | C | #include <stdio.h>
int main() {
int n;
int i,j,e;
int a[101],b[101];
int t,minj,flag;
char c[101],kara,m,d[101],f[4];
char str[3];
int sta = 0;
scanf("%d", &n);
for(i=0; i<n; i++) {
scanf("%s",str);
c[i] = str[0];
a[i] = str[1] - '0';
// printf("%c %d\n",c[i],a[i]);
b[i... | main.c:120:1: error: unknown type name 'Compile'
120 | Compile Error Logs:
| ^~~~~~~
main.c:120:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Logs'
120 | Compile Error Logs:
| ^~~~
main.c:125:6: error: stray '#' in program
125 | Case # Verdict CPU Time Memor... |
s636245554 | p02261 | C | #include<stdio.h>
typedef struct{
char suit;
char num;
int idx;
}Card;
void print(Card* A, int N){
int i;
for(i = 0; i < N; i++){
if(i) printf(" ");
printf("%c%c",A[i].suit,A[i].num);
}
printf("\n");
}
void is_stable(Card* A, int N){
int i;
for(i = 0; i+1 < N; i++)
if(A[i].num == A[i... | main.c:74:1: error: unknown type name 'Compile'
74 | Compile Error Logs:
| ^~~~~~~
main.c:74:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Logs'
74 | Compile Error Logs:
| ^~~~
main.c:77:81: error: invalid digit "8" in octal constant
77 | Judge: 10/10 C ... |
s465376554 | p02261 | C | #include<stdio.h>
#define N 36
struct kazu {
int value;
}
main(){
int i,j,n,a[N],b,d[N],e;
struct kazu c;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",a[i]);
d[i] = a[i];
}
for(i=0;i<n-1;i++){
minj = i;
for(j=n-1;j<0;j--){
if(c[j].value < c[minj].value){
minj = j;
}
b... | main.c: In function 'main':
main.c:18:5: error: 'minj' undeclared (first use in this function)
18 | minj = i;
| ^~~~
main.c:18:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:11: error: subscripted value is neither array nor pointer nor vector
20 |... |
s766556380 | p02261 | C | #include<stdio.h>
#define N 36
struct kazu {
int value;
char mozi;
}
main(){
int i,j,n;
char m;
struct kazu a[N],d[N],b,e;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%c%d",&a[i].mozi,&a[i].value);
d[i] = a[i];
}
for(i=0;i<n-1;i++){
minj = i;
for(j=n-1;j<i;j--){
if(a[j].value < a... | main.c: In function 'main':
main.c:20:5: error: 'minj' undeclared (first use in this function)
20 | minj = i;
| ^~~~
main.c:20:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:55:6: error: expected expression before ')' token
55 | if()
| ^... |
s773224099 | p02261 | C | #include <stdio.h>
struct {
char mark;
int num;
} typedef Card;
void bubble(int, Card *);
void select(int, Card *);
void result(int, Card *);
void judge(int, Card *);
int main(){
Card C[36] ,D[36], F[36];
int n, x, i, j;
scanf("%d" ,&n);
scanf(" %c%d " ,&C[0].mark ,&C[0].num);
for(i = 1; i < n - 1; i... | main.c: In function 'main':
main.c:33:3: error: too many arguments to function 'bubble'
33 | bubble(n, C, F);
| ^~~~~~
main.c:8:6: note: declared here
8 | void bubble(int, Card *);
| ^~~~~~
main.c:34:3: error: too many arguments to function 'select'
34 | select(n, D, F);
| ^~~~~... |
s149130925 | p02261 | C | #include <stdio.h>
struct {
char mark;
int num;
} typedef Card;
void bubble(int, Card *, Card *);
void select(int, Card *, Card *);
void result(int, Card *);
void judge(int, Card *, Card *);
int main(){
Card C[36] ,D[36], F[36];
int n, x, i, j;
scanf("%d" ,&n);
scanf(" %c%d " ,&C[0].mark ,&C[0].num);
... | main.c: In function 'judge':
main.c:108:14: error: subscripted value is neither array nor pointer nor vector
108 | check[i].mark = C[i].mark;
| ^
main.c:109:14: error: subscripted value is neither array nor pointer nor vector
109 | check[i].num = C[i].num;
| ^
m... |
s209295993 | p02261 | C | #include <stdio.h>
struct {
char mark;
int num;
} typedef Card;
void bubble(int, Card *, Card *);
void select(int, Card *, Card *);
void result(int, Card *);
void judge(int, Card *, Card *);
int main(){
Card C[36] ,D[36], F[36];
int n, x, i, j;
scanf("%d" ,&n);
scanf(" %c%d " ,&C[0].mark ,&C[0].num);
... | main.c: In function 'judge':
main.c:108:14: error: subscripted value is neither array nor pointer nor vector
108 | check[i].mark = C[i].mark;
| ^
main.c:109:14: error: subscripted value is neither array nor pointer nor vector
109 | check[i].num = C[i].num;
| ^
m... |
s209431821 | p02261 | C | #include <stdio.h>
struct {
char mark;
int num;
} typedef Card;
void bubble(int, Card *, Card *);
void select(int, Card *, Card *);
void result(int, Card *);
void judge(int, Card *, Card *);
int main(){
Card C[36] ,D[36], F[36];
int n, x, i, j;
scanf("%d" ,&n);
scanf(" %c%d " ,&C[0].mark ,&C[0].num);
... | main.c: In function 'judge':
main.c:108:14: error: subscripted value is neither array nor pointer nor vector
108 | check[i].mark = C[i].mark;
| ^
main.c:109:14: error: subscripted value is neither array nor pointer nor vector
109 | check[i].num = C[i].num;
| ^
m... |
s509206727 | p02261 | C | #include <stdio.h>
struct {
char mark;
int num;
} typedef Card;
void bubble(int, Card *, Card *);
void select(int, Card *, Card *);
void result(int, Card *);
void judge(int, Card *, Card *);
int main(){
Card C[36] ,D[36], F[36];
int n, x, i, j;
scanf("%d" ,&n);
scanf(" %c%d " ,&C[0].mark ,&C[0].num);
... | main.c: In function 'judge':
main.c:108:14: error: subscripted value is neither array nor pointer nor vector
108 | check[i]->mark = C[i].mark;
| ^
main.c:109:14: error: subscripted value is neither array nor pointer nor vector
109 | check[i]->num = C[i].num;
| ^... |
s108702127 | p02261 | C | #include <stdio.h>
struct {
char mark;
int num;
} typedef Card;
void bubble(int, Card *);
void select(int, Card *);
void result(int, Card *);
void judge(int, Card *);
int main(){
Card C[36] ,D[36], F[36];
int n, x, i, j;
scanf("%d" ,&n);
scanf(" %c%d " ,&C[0].mark ,&C[0].num);
for(i = 1; i < n - 1; i... | main.c: In function 'main':
main.c:33:3: error: too many arguments to function 'bubble'
33 | bubble(n, C, F);
| ^~~~~~
main.c:8:6: note: declared here
8 | void bubble(int, Card *);
| ^~~~~~
main.c:34:3: error: too many arguments to function 'select'
34 | select(n, D, F);
| ^~~~~... |
s846992207 | p02261 | C | ??#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void bubble_sort(char **,int);
void select_sort(char **,char **,int);
int main(){
int i=0,j,element;
char **matrix_bubble,**matrix_select;
scanf("%d",&element);
matrix_bubble = malloc(sizeof(char*) * element);
matrix_select = malloc(sizeof(char*)... | main.c:1:1: error: expected identifier or '(' before '?' token
1 | ??#include<stdio.h>
| ^
main.c:1:3: error: stray '#' in program
1 | ??#include<stdio.h>
| ^
In file included from main.c:2:
/usr/include/stdlib.h:98:8: error: unknown type name 'size_t'
98 | extern size_t __ctype_get_mb_cur_max ... |
s389646831 | p02261 | C | #include <stdio.h>
#define TRUE 1
#define FALSE 0
#define LOOP_INIT 0
#define CARD_ARRAY_MAX 36
#define EXIT_SUCCESS 0
#define PREV_ITEM( x ) x - 1
int main( void )
{
unsigned char ubW_Dcard_cnt;
unsigned char ubW_Dbubble_card_mark_array[ CARD_ARRAY_MAX ];
unsigned char ubW_Dbubble_card_num_array[ CARD_ARRAY_MAX ]... | main.c: In function 'main':
main.c:24:30: error: 'INIT' undeclared (first use in this function)
24 | for( ubW_Cloop_cnt = INIT; ubW_Cloop_cnt < ubW_Dcard_cnt; ubW_Cloop_cnt++ ){
| ^~~~
main.c:24:30: note: each undeclared identifier is reported only once for each function it... |
s869108752 | p02261 | C | #include<stdio.h>
#include<string.h>
int main(){
int n,i,j;
char incard[36][3],outcardx[36][3],outcardy[36][3];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",incard[i]);
outcardx[i]=incard[i];//strncpy
outcardy[i]=incard[i];
}
//bubble
for(i=0;i<n;i++){
for(j=0;j<n-1;j++){
if(outcardx... | main.c: In function 'main':
main.c:9:16: error: assignment to expression with array type
9 | outcardx[i]=incard[i];//strncpy
| ^
main.c:10:16: error: assignment to expression with array type
10 | outcardy[i]=incard[i];
| ^
main.c:16:9: error: implicit declaration... |
s586090275 | p02261 | C | #include <stdio.h>
#define N 36
#define exch(a, b) {card x = a; a = b; b = x;}
#define less(a, b) (a.num < b.num)
#define compexch(a, b) {if(less(a, b))exch(a, b);}
typedef struct{
char mark, num;
}card;
void printarr(card *a, int n){
int i;
for(i = 0; i < n; i++){
printf("%c%c", a[i].mark, a[i].num);
p... | main.c: In function 'main':
main.c:53:3: error: too many arguments to function 'bubblesort'
53 | bubblesort(bubble, n, 0);
| ^~~~~~~~~~
main.c:30:6: note: declared here
30 | void bubblesort(card *a, int n){
| ^~~~~~~~~~
|
s182752195 | p02261 | C | #include <stdio.h>
#include <stdlib.h>
#define TRUE 1
#define FALSE 0
typedef struct tag_card {
char suit_;
int num_;
} card_t;
void DisplayArray(card_t C[], int N)
{
int i;
for (i = 0; i < N; i++) {
if (i) printf(" ");
printf("%c%d", C[i].suit_, C[i].num_);
}
printf("\n");
}
... | main.c: In function 'main':
main.c:75:23: error: 'C' undeclared (first use in this function); did you mean 'C2'?
75 | C2[i].suit_ = C[i].suit_;
| ^
| C2
main.c:75:23: note: each undeclared identifier is reported only once for each function it appears in... |
s351623271 | p02261 | C | #include <stdio.h>
#define X 36
int main()
{
int N,i,C[X];
scanf("%d",&N);
if(N>=1 && N<=36){
for(i=0;i<N;i++){
scanf("%d",&C[i]);
}
i=0;
for(i=0;i<N;i++){
minj=i;
for(j=i;j<N;j++){
if(A[j]<A[minj]){
minj=j;
}
}
if(A[i]!=A[minj]){
temp=A[i];
A[i]=A[minj];
A... | main.c: In function 'main':
main.c:15:7: error: 'minj' undeclared (first use in this function)
15 | minj=i;
| ^~~~
main.c:15:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:11: error: 'j' undeclared (first use in this function)
16 | for(j... |
s807579759 | p02261 | C | #include<stdio.h>
#define N 36
int main(){
int i,j,n,min,hantei1=1,hantei2=1,a,b,cnum[N],cnum2[N],innum[N],nchange;
char ccard[N],ccard2[N],incard[N],cchange,jud[N];
scanf("%d",&n);
for(i = 0;i < n;i++){
while(1){
scanf("%c",&ccard[i]);
if(ccard[i] != 'S' && ccard[i] != 'H'&& ccard[i] != 'C' && ... | main.c: In function 'main':
main.c:57:22: error: 'innu' undeclared (first use in this function); did you mean 'innum'?
57 | if(innum[i] == innu [j]){
| ^~~~
| innum
main.c:57:22: note: each undeclared identifier is reported only once for each function it ap... |
s987206252 | p02261 | C | #include<stdio.h>
#define N 36
int main(){
int i,j,n,min,hantei1=1,hantei2=1,a,b,cnum[N],cnum2[N],innum[N],nchange,k=0,l;
char ccard[N],ccard2[N],incard[N],cchange,jud[N];
scanf("%d",&n);
for(i = 0;i < n;i++){
while(1){
scanf("%c",&ccard[i]);
if(ccard[i] != 'S' && ccard[i] != 'H'&& ccard[i] != '... | main.c: In function 'main':
main.c:63:8: error: expected ';' before 'for'
63 | l = k
| ^
| ;
64 | for(i = 0;i < n;i++){
| ~~~
|
s740484064 | p02261 | C | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args)throws NumberFormatException,IOException{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String buf = ... | main.c:1:1: error: unknown type name 'import'
1 | import java.io.BufferedReader;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.io.BufferedReader;
| ^
main.c:2:1: error: unknown type name 'import'
2 | import java.io.IOExc... |
s128631226 | p02261 | C | include <stdio.h>
typedef struct {
char c;
int n;
} card;
void Bubblesort(card *, int);
void SelectionSort(card *, int);
int main() {
card A[36],B[36],x;
int i,j,k,N;
scanf("%d",&N);
for(i = 0; i < N; i++) {
scanf(" %c%d",&A[i].c,&A[i].n);
}
for(i = 0; i < N; i++) {
B[i].c = A[i].c;
... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
main.c:6:3: warning: data definition has no type or storage class
6 | } card;
| ^~~~
main.c:6:3: error: type defaults to 'int' in declaration of 'card' [-Wimplicit-int]
main.c:8:1... |
s259789553 | p02261 | C | include <stdio.h>
typedef struct {
char c;
int n;
} card;
void Bubblesort(card *, int);
void SelectionSort(card *, int);
int main() {
card A[36],B[36],x;
int i,j,k,N;
scanf("%d",&N);
for(i = 0; i < N; i++) {
scanf(" %c%d",&A[i].c,&A[i].n);
}
for(i = 0; i < N; i++) {
B[i].c = A[i].c;
... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
main.c:6:3: warning: data definition has no type or storage class
6 | } card;
| ^~~~
main.c:6:3: error: type defaults to 'int' in declaration of 'card' [-Wimplicit-int]
main.c:8:1... |
s244421742 | p02261 | C | #include<stdio.h>
struct Card{char suit,value;};
struct Card t,C1[100],C2[100];
void bubble(struct Card A[],int N){
int i,j;
for( i = 0;i < N; i++){
for(j = N - 1; j >= 0; j--){
if(A[j].value<A[j-1].value){
t = A[j];
A[j] = A[j-1];
A[j] = t;
}
}
}
}
void selection(Card A[],int N){
int i,... | main.c:17:16: error: unknown type name 'Card'
17 | void selection(Card A[],int N){
| ^~~~
main.c:30:12: error: unknown type name 'Card'
30 | void print(Card A[],int N){
| ^~~~
main.c: In function 'isStable':
main.c:51:1: error: expected declaration or statement at end of inpu... |
s329782720 | p02261 | C | #include<stdio.h>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string.h>
using namespace std;
#define BUF_SIZE 1024
#define ARRAY_SIZE 36
void selectionSort(char array[ARRAY_SIZE][3],int n)
{
int min;
char tmp[3];
for(int i = 0; i < n-1; i++){
min = i; //?????????
for(int j = i+1; j < ... | main.c:2:10: fatal error: sstream: No such file or directory
2 | #include <sstream>
| ^~~~~~~~~
compilation terminated.
|
s078196766 | p02261 | C | #include <stdio.h>
typedef struct{
char suit;
int value;
} Card;
void bubble(Card A[], int N){
int i, j;
Card t;
for(i=0; i<N; i++){
for(j=N-1; j>=i+1; j--){
if(A[j].value<A[j-1].value){
t = A[j];
A[j] = A[j-1];
A[j-1] = t;
}
}
}
}
void selection(Card A[], in... | main.c: In function 'main':
main.c:62:9: error: incompatible types when assigning to type 'Card' from type 'int'
62 | for(i=0; i<N; i++){
| ^
main.c:62:13: error: invalid operands to binary < (have 'Card' and 'int')
62 | for(i=0; i<N; i++){
| ^
main.c:62:18: error: wrong type a... |
s826776756 | p02261 | C | #include <stdio.h>
typedef struct{
char suit;
int value;
} Card;
void bubble(Card,int);
void selection(Card,int);
void print(Card,int);
void stable(Card,Card,int);
void bubble(Card A[], int N){
int i, j;
Card t;
for(i=0; i<N; i++){
for(j=N-1; j>=i+1; j--){
if(A[j].value<A[j-1].value){
t =... | main.c:13:6: error: conflicting types for 'bubble'; have 'void(Card *, int)'
13 | void bubble(Card A[], int N){
| ^~~~~~
main.c:8:6: note: previous declaration of 'bubble' with type 'void(Card, int)'
8 | void bubble(Card,int);
| ^~~~~~
main.c:27:6: error: conflicting types for 'selection';... |
s452587382 | p02261 | C | #include <stdio.h>
typedef struct{
char suit;
int value;
} Card;
void bubbleSort(Card*,int);
void selectionSort(Card* ,int);
void printSort(Card*,int);
int stableSort(Card*,Card*,int);
void bubbleSort(Card A[], int N){
int i, j;
Card t;
for(i=0; i<N; i++){
for(j=N-1; j>=i+1; j--){
if(A[j]->value<... | main.c: In function 'bubbleSort':
main.c:18:14: error: invalid type argument of '->' (have 'Card')
18 | if(A[j]->value<A[j-1]->value){
| ^~
main.c:18:28: error: invalid type argument of '->' (have 'Card')
18 | if(A[j]->value<A[j-1]->value){
| ^~
main... |
s287280378 | p02261 | C | #include<stdio.h>
#define N 36
typedef struct{
int value;
char moji;}C;
int main(){
int i,j,n,flag=0,x,minj,count;
char c;
C C[N],M[N];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf(" %c%d",&C[i].moji,&C[i].value);
M[i]=C[i];}
flag=1;
i=0;
while(flag){
flag=0;
for(j=n-1;... | main.c: In function 'main':
main.c:76:3: error: expected expression before '}' token
76 | }
| ^
|
s359344028 | p02261 | C | #include <stdio.h>
void BubbleSort(int);
void SelectionSort(int);
typedef struct{
char mark;
int number;
} card;
card Bubble[100];
card Select[100];
card in[100];
int main()
{
int i,j,N,flag;
scanf("%d",&N);
for(i = 0;i < N;i++){
scanf("%c",&in[i].mark);
scanf("%d ",&in[i].number);
}
for(i ... | main.c: In function 'main':
main.c:48:11: error: 'a' undeclared (first use in this function)
48 | for(a = 0;a < N;a++){
| ^
main.c:48:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:49:13: error: 'b' undeclared (first use in this function)
49... |
s023104668 | p02261 | C | #include "stdafx.h"
#include<stdio.h>
#include<string.h>
typedef struct{ char c; int n; } card;
card B[36], S[36];
int bubble(card A[36], int N)
{
int i, j, c = 0, flag = 1;
card stock;
while (flag)
{
flag = 0;
for (i = N - 1; i>0; i--)
{
if (A[i].n<A[i - 1].n)
{
stock = A[i];
A[i] = A[i - 1];
... | main.c:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s277662429 | p02261 | C |
#include<stdio.h>
#include<string.h>
typedef struct{ char c; int n; } card;
card B[36], S[36];
int bubble(card A[36], int N)
{
int i, j, c = 0, flag = 1;
card stock;
while (flag)
{
flag = 0;
for (i = N - 1; i>0; i--)
{
if (A[i].n<A[i - 1].n)
{
stock = A[i];
A[i] = A[i - 1];
A[i - 1] = stock... | main.c: In function 'main':
main.c:48:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
48 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s532755032 | p02261 | C | #include<stdio.h>
#include<string.h>
using namespace std;
char a[100];
char c[100],c1[100],c2[100],b[100],b1[100],b2[100];
int main()
{
int n;
int j=0,g=0;
int m;
scanf("%d\n",&n);
gets(a);
int d=strlen(a);
for(int i=0;i<d;i++)
{
if(a[i]>64)
{
b[j]=a[i];
... | main.c:3:1: error: unknown type name 'using'
3 | using namespace std;
| ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
3 | using namespace std;
| ^~~
main.c: In function 'main':
main.c:14:5: error: implicit declaration of function 'gets'; did ... |
s588131814 | p02261 | C | #include <stdio.h>
typedef struct{
char suit;
char value;
} card;
void bubble(card *p,int N);
int selection(card *p,int N);
int main(){
card p1[50];
card p2[50];
int i,N;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf(" %c%c",&p1[i].suit,&p1[i].value);
}
for(i=0;i<N;i++){
p2[i]=p1[i];
}
bubble(p1,N);
f... | main.c: In function 'selection':
main.c:74:25: error: expected declaration or statement at end of input
74 | }
| ^
main.c:74:25: error: expected declaration or statement at end of input
main.c:74:25: error: expected declaration or statement at end of input
|
s843061743 | p02261 | C | #include <stdio.h>
#include <stdlib.h>
#define swap(a, b, type) {type t; t=a; a=b; b=t;}
typedef struct {
int num;
char suit;
} CARD;
char getSuit(CARD *card);
int getNumber(CARD *card);
void setSuit(CARD *card, char suit);
void setNumber(CARD *card, int num);
void printCard(CARD *card);
int compCard(CARD *c1, CA... | main.c:92:5: error: conflicting types for 'setNumber'; have 'int(CARD *, int)'
92 | int setNumber(CARD *card, int num)
| ^~~~~~~~~
main.c:13:6: note: previous declaration of 'setNumber' with type 'void(CARD *, int)'
13 | void setNumber(CARD *card, int num);
| ^~~~~~~~~
main.c: In function 'se... |
s690028332 | p02261 | C | {
if (A[j].num<A[j-1].num){
t=A[j];A[j]=A[j-1];A[j-1]=t;
flag=1;
}
}
}
}
void selectSort(struct CARD A[],int N)
{
struct CARD t;
int minj,j,i;
for (i=0;i<N-1;i++){
minj=i;
for (j=i+1;j<N;j++){
if (A[j].num<A[minj].num)minj=j;
}
t=A[i];A[i]=A[minj];A[minj]=t;
}
}
void trace(struct CARD ... | main.c:1:1: error: expected identifier or '(' before '{' token
1 | {
| ^
main.c:7:9: error: expected identifier or '(' before '}' token
7 | }
| ^
main.c:8:1: error: expected identifier or '(' before '}' token
8 | }
| ^
main.c:10:29: error: array type has incomplete element ... |
s079767455 | p02261 | C | #include<stdio.h>
#include<string.h>
using namespace std;
char a[105][5];
char b[105][5];
int q=1;
void squt(char a[],char b[]){
char s[105];
strcpy(s,a);
strcpy(a,b);
strcpy(b,s);
}
int main(){
int n;
char s;
scanf("%d%c",&n,&s);
for(int i=0;i<n;i++){
scanf("%s",a[i]);
strcpy(b[i],a[i]);
}
... | main.c:3:1: error: unknown type name 'using'
3 | using namespace std;
| ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
3 | using namespace std;
| ^~~
|
s826468667 | p02261 | C | #include <stdio.h>
#include <string.h>
#define N 36;
typedef struct{
char c;
int n;
} Card;
void bubble_sort(Card*, int);
void selec_sort(Card*, int);
int main(int argc, char const *argv[]) {
int i;
int num;
Card card[N],bubble[N],selec[N];
scanf("%d",&num);
for( i = 0 ; i < num ; i++ ){
sca... | main.c: In function 'main':
main.c:4:13: error: expected ']' before ';' token
4 | #define N 36;
| ^
main.c:21:13: note: in expansion of macro 'N'
21 | Card card[N],bubble[N],selec[N];
| ^
main.c:21:24: error: expected statement before ']' token
21 | Card card[N],bubble[... |
s619825993 | p02261 | C | free(A);
return 0;
}
void BubbleSort(char **A,int N){
int i,j,*B,n;
char keep[2];
B=(int*)malloc(sizeof(int)*N);
for(i=0;i<N;i++)
B[i]=A[i][1]-48;
for(j=0;j<N;j++){
for(i=N-1;i>0;i--){
if(B[i]<B[i-1]){
n=B[i];
B[i]=B[i-1];
B[i-1]=n;
keep[0]=A[i][0];
A[i][0]=A[i-1][0];
A[i-1][0]=keep[0... | main.c:1:3: warning: data definition has no type or storage class
1 | free(A);
| ^~~~
main.c:1:3: error: type defaults to 'int' in declaration of 'free' [-Wimplicit-int]
main.c:1:3: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
main.c:1:3: warning: c... |
s838138898 | p02261 | C | aa | main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
1 | aa
| ^~
|
s427223565 | p02261 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 36
typedef struct{
char gara;
int number;
}card;
void Swap(card*x,card*y){
card temp;
temp=*x;
*x=*y;
*y=temp;
}
void bubble(card *after,int n){
int i,j;
for(i=0;i<n;i++){
for(j=n-1;j>i;j--){
if(after[j].number<after[j-1].num... | main.c:25:6: error: conflicting types for 'select'; have 'void(card *, int)'
25 | void select(card *after,int n){
| ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /usr/include/stdlib.h:514,
from main.c:2:
/usr/include/x86_64-linux-gnu/sys... |
s935588949 | p02261 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 36
typedef struct{
char gara;
int number;
}card;
void Swap(card*x,card*y){
card temp;
temp=*x;
*x=*y;
*y=temp;
}
void bubble(card *after,int n){
int i,j;
for(i=0;i<n;i++){
for(j=n-1;j>i;j--){
if(after[j].number<after[j-1].num... | main.c:25:6: error: conflicting types for 'select'; have 'void(card *, int)'
25 | void select(card *after,int n){
| ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /usr/include/stdlib.h:514,
from main.c:2:
/usr/include/x86_64-linux-gnu/sys... |
s081085478 | p02261 | C | #Include <stdio.h>
#include <stdbool.h>
#include <string.h>
typedef struct{
char c;
int num;
}pair;
void bubblesort(pair* , int );
void selectionsort(pair* , int);
//bool stable(pair*, pair* ,int );
int main(){
int e,n,i,j,temp,flag = 0;
pair box[64];
pair in1[64];
pair in2[64];
char emp;
scanf("%d... | main.c:1:2: error: invalid preprocessing directive #Include; did you mean #include?
1 | #Include <stdio.h>
| ^~~~~~~
| include
main.c: In function 'main':
main.c:22:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
22 | scanf("%d\n",&n);
| ^~~~~
main.c:4... |
s727449967 | p02261 | C | #include<stdio.h>
#include<stdlib.h>
typedef struct{
char Mark;
int Number;
} Card;
void SelectionSort(Card *,int);
void BubbleSort(Card *,int);
Card Kakunou(char*);
int main() {
int i,j,k,sum,num;
scanf("%d",&sum);
char card[sum][2];
Card card1[sum],BubleCard[sum],SelectCard[sum];
for(i=0;i<sum;i++)... | main.c: In function 'main':
main.c:31:3: error: implicit declaration of function 'SelectSort'; did you mean 'SelectionSort'? [-Wimplicit-function-declaration]
31 | SelectSort(SelectCard,sum);
| ^~~~~~~~~~
| SelectionSort
|
s444275265 | p02261 | C | #include <stdio.h>
#define false -1
#define true 1
typedef struct{
char design;
int number;
}card;
int bubbleSort(card[],int);
int SelectionSort(card[],int);
int isStable(card[],card[],int);
int main(){
int i,N = 0;
scanf("%d",&N);
card Card[N];
for(i = 0; i < N; i++){
scanf(" %c%d",&Card[i].design,&Car... | main.c:73:3: error: expected identifier or '(' before 'for'
73 | for(i = 0; i <= N-1; i++){
| ^~~
main.c:73:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
73 | for(i = 0; i <= N-1; i++){
| ^~
main.c:73:25: error: expected '=', ',', ';', 'asm' or '__a... |
s799838023 | p02261 | C | #include <stdio.h>
#include <string.h>
/*char card[40][3], card_i[40][3];
void BubbleSort(int n);
void SelectionSort(int n);
void write(int n);
void stable(int n);
int main(void){
int n, i, j;
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%s", card[i]);
strcpy(card_i[i], card[i]);
}
BubbleSor... | main.c: In function 'main':
main.c:136:19: error: 'card' undeclared (first use in this function)
136 | scanf("%c%d", card[i].mark, card[i].num);
| ^~~~
main.c:136:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:137:21: error: passing argume... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.