submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s822437005 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int n) {
for ( int i = 0; i < n; i++ ){
for ( int j = n - 1; j >= i + 1; j-- ){
if( A[j].value < A[j - 1].value ){
Card t = A[j];
A[j] = A[j - 1];
... | a.cc: In function 'int main()':
a.cc:61:18: error: expected ';' before 'selection'
61 | bubble(C1, n)
| ^
| ;
62 | selection(C2, n);
| ~~~~~~~~~
|
s755552767 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++ ){
for ( int j = N - 1; j >= i + 1; j-- ){
if( A[j].value < A[j - 1].value ){
Card t = A[j];
A[j] = A[j - 1];
... | a.cc: In function 'int main()':
a.cc:61:18: error: expected ';' before 'selection'
61 | bubble(C1, N)
| ^
| ;
62 | selection(C2, N);
| ~~~~~~~~~
|
s674468753 | p02261 | C++ | #include <iostream>
using namespace std;
int main()
{
int n = 0 , minj = 0, flag = 1, k = 0;
char a[36][3], b[36][3], temp[3];
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++)
strcpy_s(b[i], a[i]);
while (flag) {
flag = 0;
for (int j = n - 1; j > 0; j--) {
if (b[j][1]... | a.cc: In function 'int main()':
a.cc:15:17: error: 'strcpy_s' was not declared in this scope
15 | strcpy_s(b[i], a[i]);
| ^~~~~~~~
a.cc:21:33: error: 'strcpy_s' was not declared in this scope
21 | strcpy_s(temp, b[j - 1]);
| ... |
s501794400 | p02261 | C++ | #include <iostream>
#include <string.h>
using namespace std;
int main()
{
int n = 0 , minj = 0, flag = 1, k = 0;
char a[36][3], b[36][3], temp[3];
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++)
strcpy_s(b[i], a[i]);
while (flag) {
flag = 0;
for (int j = n - 1; j > 0; j... | a.cc: In function 'int main()':
a.cc:16:17: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
16 | strcpy_s(b[i], a[i]);
| ^~~~~~~~
| strcpy
a.cc:22:33: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
22 | ... |
s749887018 | p02261 | C++ | #include <iostream>
#include <string.h>
using namespace std;
int main()
{
int n = 0 , minj = 0, flag = 1, k = 0;
char a[36][3], b[36][3], temp[3];
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++)
strcpy_s(b[i], a[i]);
while (flag) {
flag = 0;
for (int j = n - 1; j > 0; j... | a.cc: In function 'int main()':
a.cc:16:17: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
16 | strcpy_s(b[i], a[i]);
| ^~~~~~~~
| strcpy
a.cc:56:17: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
56 | ... |
s963078430 | p02261 | C++ | #include <iostream>
using namespace std;
int main(){
bool flag = true;
pair<char, int> C[36], E[36], D;
int N, i, j, k, minj;
cin >> N;
for (i = 0; i < N; i++) {
cin >> C[i].first >> C[i].second;
E[i] = C[i];
}
for (i = 0; i < N; i++){
for (j = N - 1; j > i; j--){
if (C[j].second < C[j - 1].second) ... | a.cc: In function 'int main()':
a.cc:48:54: error: expected '}' at end of input
48 | cout << endl << "Not stable" << endl;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s915073711 | p02261 | C++ | #include <stdio.h>
#include <stdint.h>
#include <iostream>
#include <fstream>
#include <cassert>
#include <vector>
using namespace std;
#define DEBUG (1)
#ifdef DEBUG
#define DPRINT(...) printf("D(L%d)%s: ", __LINE__, __func__); printf(__VA_ARGS__)
#else
#define DPRINT(...)
#endif
struct Card {
Card() { };
Card... | a.cc: In member function 'void Solution::run()':
a.cc:97:1: error: expected primary-expression before ':' token
97 | :set nonumber
| ^
a.cc:97:14: error: expected '}' at end of input
97 | :set nonumber
| ^
a.cc:96:22: note: to match this '{'
96 | void Solution::run() {
| ... |
s917461340 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++ ) {
for ( int j = N - 1; j >= i; j--) {
if ( A[j].value < A[j - 1].value ) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void selectio... | a.cc:58:11: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
58 | cout << 'stable' << endl;
| ^~~~~~~~
a.cc:16:6: error: variable or field 'selection' declared void
16 | void selection(strudt Card A[], int N) {
| ^~~~~~~~~
a.cc:16:16: error: 'strudt' wa... |
s515488772 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++ ) {
for ( int j = N - 1; j >= i; j--) {
if ( A[j].value < A[j - 1].value ) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void selec... | a.cc:58:11: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
58 | cout << 'stable' << endl;
| ^~~~~~~~
a.cc: In function 'void selection(Card*, int)':
a.cc:22:28: error: invalid types 'Card*[<unresolved overloaded function type>]' for array subscript
22 | Card... |
s121341275 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit; int value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++ ) {
for ( int j = N - 1; j >= i; j--) {
if ( A[j].value < A[j - 1].value ) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void s... | a.cc:58:11: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
58 | cout << 'stable' << endl;
| ^~~~~~~~
a.cc:16:6: error: variable or field 'selection' declared void
16 | void selection(strudt Card A[], int N) {
| ^~~~~~~~~
a.cc:16:16: error: 'strudt' wa... |
s088162008 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++ ) {
for ( int j = N - 1; j >= i; j--) {
if ( A[j].value < A[j - 1].value ) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void selec... | a.cc:16:6: error: variable or field 'selection' declared void
16 | void selection(strudt Card A[], int N) {
| ^~~~~~~~~
a.cc:16:16: error: 'strudt' was not declared in this scope; did you mean 'struct'?
16 | void selection(strudt Card A[], int N) {
| ^~~~~~
| s... |
s800925681 | p02261 | C++ | include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++ ) {
for ( int j = N - 1; j >= i; j--) {
if ( A[j].value < A[j - 1].value ) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void sel... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'void selection(Card*, int)':
a.cc:22:29: error: 'min' was not declared in this scope; did you mean 'minj'?
22 | Card t = A[i]; A[i] = A[min]; A[minj] = t;
| ^~~
| ... |
s946942176 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++ ) {
for ( int j = N - 1; j >= i; j--) {
if ( A[j].value < A[j - 1].value ) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void... | a.cc: In function 'void selection(Card*, int)':
a.cc:22:28: error: invalid types 'Card*[<unresolved overloaded function type>]' for array subscript
22 | Card t = A[i]; A[i] = A[min]; A[minj] = t;
| ^
|
s275957128 | p02261 | C++ | #include <iostream>
using namespace std;
const int MAX = 36;
struct Card {
char suit;
char value;
};
void Print(Card* C, int N) {
for (int i = 0; i < N - 1; i++)
cout << C[i].suit << C[i].value << " ";
cout << C[N - 1].suit << C[N - 1].value << endl;
}
void BubbleSort(Card* C, int N) {
for (int i = 0; ... | a.cc: In function 'int main()':
a.cc:52:3: error: 'memcpy' was not declared in this scope
52 | memcpy(C2, C1, sizeof(Card) * MAX);
| ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstrin... |
s228209912 | p02261 | C++ | #include <iostream>
#include <cassert>
struct Card {
char suit;
int value;
};
void bubble_sort(Card cards[], const int n) {
bool sorted;
while(!sorted) {
sorted = true;
for (int i = n - 1; i > 0; i--) {
if (cards[i].value < cards[i - 1].value) {
Card tmp = cards[i];
cards[i] = ... | a.cc: In function 'int main()':
a.cc:91:12: error: 'i' was not declared in this scope
91 | sorted[i] = input[i];
| ^
|
s461542296 | p02261 | C++ | #include <iostream>
#include <cassert>
struct Card {
char suit;
int value;
};
void bubble_sort(Card cards[], const int n) {
bool sorted;
while(!sorted) {
sorted = true;
for (int i = n - 1; i > 0; i--) {
if (cards[i].value < cards[i - 1].value) {
Card tmp = cards[i];
cards[i] = ... | a.cc: In function 'int main()':
a.cc:91:12: error: 'i' was not declared in this scope
91 | sorted[i] = input[i];
| ^
|
s126192282 | p02261 | C++ | Last login: Sun Jan 28 19:33:13 on console
mac-2:~ aito$ cd c++
mac-2:c++ aito$ cd aoj/
mac-2:aoj aito$ ls
algorithms intro
mac-2:aoj aito$ cd algorithms/
mac-2:algorithms aito$ ls
a.out insert_sort.cpp~ sort_stable.cpp
bubble_sort.cpp quick_sort.cpp sort_stable.cpp~
insert_sort.cpp selection_sort.cpp
mac-2:algori... | a.cc:69:59: warning: multi-character literal with 14 characters exceeds 'int' size of 4 bytes
69 | sort_stable.cpp:99:3: error: use of undeclared identifier 'insertion_sort'; did
| ^~~~~~~~~~~~~~~~
a.cc:70:16: warning: multi-character literal with 14 ch... |
s639309370 | p02261 | C++ | include <iostream>
#include <cassert>
struct Card {
char suit;
int value;
};
void bubble_sort(Card cards[], const int n) {
bool sorted;
while(!sorted) {
sorted = true;
for (int i = n - 1; i > 0; i--) {
if (cards[i].value < cards[i - 1].value) {
Card tmp = cards[i];
cards[i] = c... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:69:8: error: 'cin' is not a member of 'std'
69 | std::cin >> n;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#inclu... |
s421986135 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int n,i,j,min;
int A[36],B[36];
char a[36],b[36];
string check() { //安定・不安定評価部
for(i=0;i<n;i++) {
if(a[i]==b[i] && A[i]==B[i]) { //バブルソートと選択ソートが同じ場合安定
continue; //以下の処理をスキップ
return "Not stable"; //不安定
}
}
... | a.cc: In function 'int main()':
a.cc:37:9: error: reference to 'min' is ambiguous
37 | min=i;
| ^~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: 'template<class _Tp, class _Compare> conste... |
s566343111 | p02261 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int n,i,j,min;
int A[36],B[36];
char a[36],b[36];
string check() {
for(i=0;i<n;i++) {
if(a[i]==b[i] && A[i]==B[i]) {
continue;
return "Not stable";
}
}
return "Stable";
}
int main(void)
{
cin>>n;
... | a.cc: In function 'int main()':
a.cc:26:18: error: expected ';' before '}' token
26 | B[i]=A[i]
| ^
| ;
27 | }
| ~
a.cc:37:9: error: reference to 'min' is ambiguous
37 | min=i;
| ^~~
In file included from /us... |
s949190041 | p02261 | C++ | #include <iostream>
#include <vector>
using namespace std;
void show_vec(vector<string> &vec){
int N = vec.size();
for(int i=0; i<N; ++i){
cout << vec[i];
if(i < N-1){
cout << " ";
}
}
cout << endl;
}
int main(){
string temp;
int N;
cin >> N;
vector <string> data1(N), data2(N);
map<char, char> c... | a.cc: In function 'int main()':
a.cc:22:9: error: 'map' was not declared in this scope
22 | map<char, char> check;
| ^~~
a.cc:3:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
2 | #include <vector>
+++ |+#include <map>
3 |
a.cc:22... |
s119718994 | p02261 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
int main(){
int a[3];
scanf("%d %d %d",&a[0],&a[1],&a[2]);
sort(a,a+3);
printf("%d %d %d\n",a[0],a[1],a[2]);
}
| a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(a,a+3);
| ^~~~
| short
|
s150007097 | p02261 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
vector <string> a,b;
string tmp;
int n,i;
cin>>n;
for(i=0;i<n;i++){
cin>>tmp;
a.push_back(tmp);
}
b.assign(a.begin(),a.end());
for(i=0;i<n-1;i++) for(int j=n-2;j!=i-1;j--) if(a[j][1]>a[j+1][1]) swap(a[j],a[j+1]);
for(i=... | a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector <string> a,b;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#include <vector>
2 | #in... |
s964931124 | p02261 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
vector <string> a,b;
string tmp;
int n,i;
cin>>n;
for(i=0;i<n;i++){
cin>>tmp;
a.push_back(tmp);
}
b.assign(a.begin(),a.end());
for(i=0;i<n-1;i++) for(int j=n-2;j!=i-1;j--) if(a[j][1]>a[j+1][1]) swap(a[j],a[j+1]);
for(i=... | a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector <string> a,b;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#include <vector>
2 | #in... |
s752546743 | p02261 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
vector <string> a,b;
string tmp;
int n,i;
cin>>n;
for(i=0;i<n;i++)
{
cin>>tmp;
a.push_back(tmp);
}
b.assign(a.begin(),a.end());
for(i=0;i<n-1;i++)
{
for(int j=n-2;j!=i-1;j--)
{
if(a[j][1]>a[j+1][1])... | a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector <string> a,b;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#include <vector>
2 | #in... |
s735273836 | p02261 | C++ | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
vector <string> a,b;
string tmp;
int n,i;
cin>>n;
for(i=0;i<n;i++)
{
cin>>tmp;
a.push_back(tmp);
}
b.assign(a.begin(),a.end());
for(i=0;i<n-1;i++)
{
for(int j=n-2;j!=i-1;j--)
{
if(... | a.cc: In function 'int main()':
a.cc:33:19: error: expected ';' before 'cout'
33 | cout<<a[i]<<" "
| ^
| ;
34 | cout<<a[n-1]<<endl<<"Stable"<<endl
| ~~~~
a.cc:47:5: error: expected primary-expression before ']' token
47 | ]
| ... |
s508113989 | p02261 | C++ | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
vector <string> a,b;
string tmp;
int n,i;
cin>>n;
for(i=0;i<n;i++)
{
cin>>tmp;
a.push_back(tmp);
}
b.assign(a.begin(),a.end());
for(i=0;i<n-1;i++)
{
for(int j=n-2;j!=i-1;j--)
{
if(... | a.cc: In function 'int main()':
a.cc:33:19: error: expected ';' before 'cout'
33 | cout<<a[i]<<" "
| ^
| ;
34 | cout<<a[n-1]<<endl<<"Stable"<<endl
| ~~~~
|
s276077173 | p02261 | C++ | #include <iostream>
#include <algorithm>
#include <array>
using namespace std;
struct Card {
char suit;
int value;
bool operator==(const Card& rhs) {
return this->suit == rhs.suit && this->value == rhs.value;
}
};
static void printCard(Card cards[], int N) {
for (int i = 0; i < N; i++) {
cout << (i !... | a.cc: In function 'int main()':
a.cc:92:1: error: '\U000000e5' was not declared in this scope
92 | å selectionSort(B.data(), N);
| ^
|
s909867403 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card {
char suit;
char value;
};
int main() {
int N;
cin>>N;
Card C1[N], C2[N];
for (int i=0; i<N; i++) {
cin>>C1[i].suit>>C1[i].value;
C2[i]=C1[i];
}
for (int i=0; i<N; i++) {
for (int j=N-1; j>=i+1; j--) {
if (C1[j].value<C1[j-1].value... | a.cc: In function 'int main()':
a.cc:33:24: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'Card')
33 | cout<<(i==0?"":" ")<<C1[i]<<flush;
| ~~~~~~~~~~~~~~~~~~~^~~~~~~
| | |
| | Card
| st... |
s030938201 | p02261 | C++ | import copy
class Card(object):
def __init__(self, card):
self.suit = card[:1]
self.value = int(card[1:])
def __str__(self):
return self.suit + str(self.value)
def is_stable(bs, ss):
if bs == ss:
return 'Stable'
else:
return 'Not stable'
def bubble_sort(c,... | a.cc:13:16: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
13 | return 'Stable'
| ^~~~~~~~
a.cc:15:16: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
15 | return 'Not stable'
| ^~~~~~~~~~... |
s145066400 | p02261 | C++ | # coding: utf-8
# Stable Sort 2018/3/12
class Card(object):
def __init__(self, card):
self.value = int(card[1])
self.card = card
def __repr__(self):
return self.card
def BubbleSort(C, N):
for i in range(N):
for j in reversed(range(i+1, N)):
if C[j].value < C[j... | a.cc:1:3: error: invalid preprocessing directive #coding
1 | # coding: utf-8
| ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Stable
2 | # Stable Sort 2018/3/12
| ^~~~~~
a.cc:4:19: error: expected initializer before ':' token
4 | class Card(object):
| ^
|
s714229324 | p02261 | C++ | #include <stdio.h>
#include <iostream>
using namespace std;
struct Card
{
char suit, value;
};
void printdata(Card C[], int N)
{
for (int i = 0; i < N; i++)
{
if (i > 0)
{
cout << " ";
}
cout << C[i].suit << C[i].value;
}
cout << endl;
}
void bubbleSort(Card A[], int N)
{
int flg = 1;
int replace... | a.cc: In function 'int main()':
a.cc:81:9: error: 'memcpy' was not declared in this scope
81 | memcpy(B,A,sizeof(A));
| ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <iostream>
+++ |+#include <cstring... |
s088630267 | p02261 | C++ | n = int(input())
*bLst, = input().split()
iLst = bLst[:]
for i in range(n):
for j in range(n-1,i,-1):
if bLst[j][1] < bLst[j-1][1]:
bLst[j],bLst[j-1] = bLst[j-1],bLst[j]
print(*bLst)
print("Stable")
for i in range(n):
min = i
for j in range(i,n):
if iLst[j][1] < iLst[min][1]:
... | a.cc:1:1: error: 'n' does not name a type
1 | n = int(input())
| ^
a.cc:23:1: error: expected unqualified-id before 'else'
23 | else:
| ^~~~
|
s679714172 | p02261 | C++ | n = int(input())
*bLst, = input().split()
iLst = bLst[:]
for i in range(n):
for j in range(n-1,i,-1):
if bLst[j][1] < bLst[j-1][1]:
bLst[j],bLst[j-1] = bLst[j-1],bLst[j]
print(*bLst)
print("Stable")
for i in range(n):
min = i
for j in range(i,n):
if iLst[j][1] < iLst[min][1]:
... | a.cc:1:1: error: 'n' does not name a type
1 | n = int(input())
| ^
|
s310087895 | p02261 | C++ | #include <iostream>
#include <algorithm>
void printArray(std::string A[], int N){
for (int i = 0; i < N; i++) {
std::cout << A[i];
if (i!=N-1) {
std::cout << " ";
}
}
std::cout <<'\n';
}
std::string* bubbleSort(std::string A[], int n){
int flag=1;
int cnt=0;
int sorted_i=0;
while (fla... | a.cc: In function 'int main()':
a.cc:57:19: error: conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
57 | std::string A = new std::string[n];
| ^~~~~~~~~~~~~~~~~~
a.cc:58:19: error: co... |
s590129877 | p02261 | C++ | #include <iostream>
using namespace std;
const int MAX = 36;
struct Card
{
char suit;
int num;
};
void swap(Card c1, Card c2)
{
char char_temp;
int int_temp;
char_temp = c1.suit;
int_temp = c1.num;
c1.suit = c2.suit;
c1.num = c2.num;
c2.suit = char_temp;
c2.num = int_temp;
return void;
}
bool isEqual(Car... | a.cc: In function 'void swap(Card, Card)':
a.cc:22:16: error: expected primary-expression before 'void'
22 | return void;
| ^~~~
a.cc:22:15: error: expected ';' before 'void'
22 | return void;
| ^~~~~
| ;
a.cc:22:16: error: declaration d... |
s152971942 | p02261 | C++ | #include <iostream>
using namespace std;
const int MAX = 36;
struct Card
{
char suit;
int num;
};
void swap(Card c1, Card c2)
{
char char_temp;
int int_temp;
char_temp = c1.suit;
int_temp = c1.num;
c1.suit = c2.suit;
c1.num = c2.num;
c2.suit = char_temp;
c2.num = int_temp;
}
bool isEqual(Card c1[], Card... | a.cc: In function 'bool isEqual(Card*, Card*, int)':
a.cc:30:24: error: request for member 'suit' in 'c1', which is of pointer type 'Card*' (maybe you meant to use '->' ?)
30 | if((c1.suit != c2.suit) || (c1.num != c2.num))
| ^~~~
a.cc:30:35: error: request for member 'su... |
s277029154 | p02261 | C++ | #include <iostream>
using namespace std;
const int MAX = 36;
struct Card
{
char suit;
int num;
};
void swap(Card c1, Card c2)
{
char char_temp;
int int_temp;
char_temp = c1.suit;
int_temp = c1.num;
c1.suit = c2.suit;
c1.num = c2.num;
c2.suit = char_temp;
c2.num = int_temp;
}
bool isEqual(Card c1[], Card... | a.cc: In function 'int main()':
a.cc:51:36: error: no match for 'operator>' (operand types are 'Card' and 'Card')
51 | if(c1[j-1] > c1[j])
| ~~~~~~~ ^ ~~~~~
| | |
| Card Car... |
s986868340 | p02261 | C++ | #include <iostream>
using namespace std;
const int MAX = 36;
struct Card
{
char suit;
int num;
};
void swap(Card c1, Card c2)
{
char char_temp;
int int_temp;
char_temp = c1.suit;
int_temp = c1.num;
c1.suit = c2.suit;
c1.num = c2.num;
c2.suit = char_temp;
c2.num = int_temp;
}
bool isEqual(Card c1[], Card... | a.cc: In function 'int main()':
a.cc:70:30: error: 'c' was not declared in this scope
70 | swap(c[mini], c[i]);
| ^
|
s317007149 | p02261 | C++ | #include <iostream>
#include <cmath>
#include <string>
#include <string.h>
#include <cstdlib>
#include <iomanip>
#include <stdio.h>
#include <climits>
using namespace std;
struct card {
char suite;
int num;
};
void BubbleSort(struct card *C,int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>i;j--){
if(C... | a.cc: In function 'int main()':
a.cc:81:18: error: expected '}' at end of input
81 | puts("Stable");
| ^
a.cc:46:11: note: to match this '{'
46 | int main(){
| ^
|
s084701673 | p02261 | C++ | /*
* ITP1_6_B.cpp
*
* Created on: Apr 20, 2018
* Author: 13743
*/
#include<iostream>
#include<cmath>
using namespace std;
struct card {
char suit;
int value;
card(char suit, int value) :suit(suit), value(value) {}
};
void swap(card *a, int i, int j) {
int tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
... | a.cc: In function 'void swap(card*, int, int)':
a.cc:22:22: error: cannot convert 'card' to 'int' in initialization
22 | int tmp = a[i];
| ~~~^
| |
| card
a.cc:24:16: error: no match for 'operator=' (operand types are 'card' and 'i... |
s468889427 | p02261 | C++ | /*
* ITP1_6_B.cpp
*
* Created on: Apr 20, 2018
* Author: 13743
*/
#include<iostream>
#include<cmath>
using namespace std;
struct card {
char suit;
int value;
card(char suit, int value) :suit(suit), value(value) {}
};
void swap(card *a, int i, int j) {
card tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
... | a.cc: In function 'int main()':
a.cc:37:18: error: no matching function for call to 'card::card()'
37 | card a[36];
| ^
a.cc:18:9: note: candidate: 'card::card(char, int)'
18 | card(char suit, int value) :suit(suit), value(value) {}
| ^~~~
a.cc:18:9: note: ca... |
s873297295 | p02261 | C++ | /*
* ITP1_6_B.cpp
*
* Created on: Apr 20, 2018
* Author: 13743
*/
#include<iostream>
#include<cmath>
using namespace std;
struct card {
char suit;
int value;
card(char suit, int value) :suit(suit), value(value) {}
};
void swap(card *a, int i, int j) {
card tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
... | a.cc: In function 'int main()':
a.cc:37:23: error: could not convert '<brace-enclosed initializer list>()' from '<brace-enclosed initializer list>' to 'card'
37 | card a[36] = {};
| ^
| |
| <brace-enclosed initializer list>
a... |
s188401828 | p02261 | C++ | /*
* ITP1_6_B.cpp
*
* Created on: Apr 20, 2018
* Author: 13743
*/
#include<iostream>
#include<cmath>
using namespace std;
struct card {
char suit;
int value;
card(char suit, int value) :suit(suit), value(value) {}
};
void swap(card *a, int i, int j) {
card tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
... | a.cc: In function 'int main()':
a.cc:37:25: error: no matching function for call to 'card::card()'
37 | struct card a[36];
| ^
a.cc:18:9: note: candidate: 'card::card(char, int)'
18 | card(char suit, int value) :suit(suit), value(value) {}
| ^~~~
a.cc:18... |
s377084839 | p02261 | C++ | /*
* ITP1_6_B.cpp
*
* Created on: Apr 20, 2018
* Author: 13743
*/
#include<iostream>
#include<cmath>
using namespace std;
struct card {
char suit;
int value;
card(char suit, int value) :suit(suit), value(value) {}
};
void swap(card *a, int i, int j) {
card tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
... | a.cc: In function 'int main()':
a.cc:37:18: error: no matching function for call to 'card::card()'
37 | card a[36];
| ^
a.cc:18:9: note: candidate: 'card::card(char, int)'
18 | card(char suit, int value) :suit(suit), value(value) {}
| ^~~~
a.cc:18:9: note: ca... |
s690947077 | p02261 | C++ | /*
* ITP1_6_B.cpp
*
* Created on: Apr 20, 2018
* Author: 13743
*/
#include<iostream>
#include<cmath>
using namespace std;
struct card {
char suit;
int value;
};
void swap(card *a, int i, int j) {
card tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
void printCard(card *a, int n) {
cout << a[0].suit << a[0... | a.cc: In function 'int main()':
a.cc:75:2: error: expected '}' at end of input
75 | }
| ^
a.cc:33:12: note: to match this '{'
33 | int main() {
| ^
|
s450312879 | p02261 | C++ | #include<bits/stdc++.h>
using namespace std;
void bsort(int *b,string *a,int n){
bool j=true;
while(j){
j=false;
for(int i=1;i<n;i++){
if(*(b+i-1)>*(b+i)){j=true; swap(*(b+i-1),*(b+i)); swap(*(a+i-1),*(a+i));}
}}
}
void ssort(int *b,string *a,int n){
for(int i=0;i<n-1;i++){
string mi=*(b+i... | a.cc: In function 'void ssort(int*, std::string*, int)':
a.cc:17:15: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
17 | string mi=*(b+i);
| ^~~~~~
a.cc:20:12: error: no match for 'operator>' (operand types are 'std::string' {a... |
s740001773 | p02261 | C++ | std2dc13:doing s1260165[90]$ #include<bits/stdc++.h>
using namespace std;
void bsort(int *b,string *a,int n){
bool j=true;
while(j){
j=false;
for(int i=1;i<n;i++){
if(*(b+i-1)>*(b+i)){j=true; swap(*(b+i-1),*(b+i)); swap(*(a+i-1),*(a+i));}
}}
}
void ssort(int *b,string *a,int n){
for(int i=0;i<... | a.cc:1:30: error: stray '#' in program
1 | std2dc13:doing s1260165[90]$ #include<bits/stdc++.h>
| ^
a.cc:1:9: error: found ':' in nested-name-specifier, expected '::'
1 | std2dc13:doing s1260165[90]$ #include<bits/stdc++.h>
| ^
| ::
a.cc:1:1: error:... |
s785447253 | p02261 | C++ | #include<iostream>
#include<cstring>
using namespace std;
struct Card{
char symbol;
int number;
};
void outCards(Card C[], int N){
for(int i = 0; i < N; i++){
if(i)cout << " ";
cout << C[i].symbol << C[i].number;
}
cout << endl;
}
bool isStable(Card C1[], Card C2[], int N){
... | a.cc: In function 'void BubbleSort(Card*, int)':
a.cc:39:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
39 | return C;
| ^
|
s569082639 | p02261 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n;
int mini;
cin >> n;
int A[n];
int B[n];
char a[n],b[n];
bool stable;
for(int i=0;i<n;i++){
cin>>a[i]>>A[i];
b[i]=a[i];
B[i]=A[i];
}
for(int i=0;i<n-1;i++){
for(int j=n-1;j>i;j--){
if(A[j... | a.cc:4:1: error: extended character is not valid in an identifier
4 |
| ^
a.cc:4:1: error: extended character is not valid in an identifier
a.cc:4:1: error: extended character is not valid in an identifier
a.cc:9:1: error: extended character is not valid in an identifier
9 | int A[n];
... |
s983085003 | p02261 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
//define the structure of a card
struct _card{
char suit;
int value;
};
typedef struct _card card_t;
struct _deck{
int size;
card_t *cards;
};
typedef struct _deck deck_t;
deck_t *make_deck(int size)
{
deck_t *Deck;
Deck = malloc(sizeof(deck_t));... | a.cc: In function 'deck_t* make_deck(int)':
a.cc:24:16: error: invalid conversion from 'void*' to 'deck_t*' {aka '_deck*'} [-fpermissive]
24 | Deck = malloc(sizeof(deck_t));
| ~~~~~~^~~~~~~~~~~~~~~~
| |
| void*
a.cc:26:23: error: invalid conversion from 'voi... |
s370515960 | p02261 | C++ | #include <iostream>
#include <string>
#include <vector>
#define rep(i,s,N) for(int i=s;i<N;++i)
struct Card {
char suit,
char value;
int index;
}
template<typename T>
void swap(T& a, T& b) {
T t = a;
a = b;
b = t;
}
void print(std::vector<Card> v) {
for(int i=0;i<v.size();++i){
if (i==0) std::cout << v[i]... | a.cc:9:9: error: expected unqualified-id before 'char'
9 | char value;
| ^~~~
a.cc:11:2: error: expected ';' after struct definition
11 | }
| ^
| ;
a.cc: In function 'void print(std::vector<Card>)':
a.cc:22:58: error: '__gnu_cxx::__alloc_traits<std::allocator<Card>, Card>::val... |
s721100054 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{ char suit, value;};
void bubble(struct Card A[], int N){
Card tmp;
for( i = 0; i < N-1; i ++){
for( j = N-1; i < j; j--) {
if (C[j].value < C[j-1].value) {
tmp = A[j-1]; A[j-1] = A[j]; A[j] = tmp;
}
}
}
}
void selection(struct Ca... | a.cc: In function 'void bubble(Card*, int)':
a.cc:9:8: error: 'i' was not declared in this scope
9 | for( i = 0; i < N-1; i ++){
| ^
a.cc:10:10: error: 'j' was not declared in this scope
10 | for( j = N-1; i < j; j--) {
| ^
a.cc:11:11: error: 'C' was not declared in this scope
... |
s617045268 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{ char suit, value;};
void bubble(struct Card A[], int N){
Card tmp;
for( int i = 0; i < N-1; i++){
for( int j = N-1; i < j; j--) {
if (C[j].value < C[j-1].value) {
tmp = A[j-1]; A[j-1] = A[j]; A[j] = tmp;
}
}
}
}
void selection(st... | a.cc: In function 'void bubble(Card*, int)':
a.cc:11:11: error: 'C' was not declared in this scope
11 | if (C[j].value < C[j-1].value) {
| ^
a.cc: In function 'void selection(Card*, int)':
a.cc:25:12: error: 'C' was not declared in this scope
25 | if ( C[j].value < C[minj].value ) minj... |
s503057239 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{ char suit, value;};
void bubble(struct Card A[], int N){
Card tmp;
for( i = 0; i < N-1; i++){
for( j = N-1; i < j; j--) {
if (A[j].value < A[j-1].value) {
tmp = A[j-1]; A[j-1] = A[j]; A[j] = tmp;
}
}
}
}
void selection(struct Car... | a.cc: In function 'void bubble(Card*, int)':
a.cc:9:8: error: 'i' was not declared in this scope
9 | for( i = 0; i < N-1; i++){
| ^
a.cc:10:10: error: 'j' was not declared in this scope
10 | for( j = N-1; i < j; j--) {
| ^
a.cc: In function 'void selection(Card*, int)':
a.cc:27:... |
s895647941 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{ char suit, value;};
void bubble(struct Card A[], int N){
Card tmp;
for( int i = 0; i < N-1; i++){
for( int j = N-1; i < j; j--) {
if (A[j].value < A[j-1].value) {
tmp = A[j-1]; A[j-1] = A[j]; A[j] = tmp;
}
}
}
}
void selection(st... | a.cc: In function 'void selection(Card*, int)':
a.cc:27:26: error: 'mimj' was not declared in this scope; did you mean 'minj'?
27 | tmp = A[i]; A[i] = A[mimj]; A[minj] = tmp;
| ^~~~
| minj
a.cc:30:6: error: variable or field 'print' declared void
3... |
s653431694 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{ char suit, value;};
void bubble(struct Card A[], int N){
Card tmp;
for( int i = 0; i < N-1; i++){
for( int j = N-1; i < j; j--) {
if (A[j].value < A[j-1].value) {
tmp = A[j-1]; A[j-1] = A[j]; A[j] = tmp;
}
}
}
}
void selection(st... | a.cc: In function 'void selection(Card*, int)':
a.cc:30:6: error: variable or field 'print' declared void
30 | void print(strudt Card A[], int N) {
| ^~~~~
a.cc:30:12: error: 'strudt' was not declared in this scope; did you mean 'struct'?
30 | void print(strudt Card A[], int N) {
| ^... |
s322097065 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{ char suit, value;};
void bubble(struct Card A[], int N){
Card tmp;
for( int i = 0; i < N-1; i++){
for( int j = N-1; i < j; j--) {
if (A[j].value < A[j-1].value) {
tmp = A[j-1]; A[j-1] = A[j]; A[j] = tmp;
}
}
}
}
void selection(st... | a.cc: In function 'void selection(Card*, int)':
a.cc:30:37: error: a function-definition is not allowed here before '{' token
30 | void print(struct Card A[], int N) {
| ^
a.cc:38:58: error: a function-definition is not allowed here before '{' token
38 | bool isStable(st... |
s752014431 | p02261 | C++ | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(... | a.cc: In function 'void buble_Sort(std::vector<int>, int)':
a.cc:58:13: error: 'is_Stable' was not declared in this scope; did you mean 'notStable'?
58 | cout << is_Stable(notStable) << endl;
| ^~~~~~~~~
| notStable
a.cc: In function 'void seliction_Sort(std::vector<int>, int)... |
s435877205 | p02261 | C++ | #include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(... | a.cc: In function 'void seliction_Sort(std::vector<std::__cxx11::basic_string<char> >, int)':
a.cc:80:19: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_strin... |
s008751457 | p02261 | C++ | #include<iostream>
#include<vector>
using namespace std;
struct Card {
char suit;
char value;
};
void print(const vector<Card>& A) {
for(int i = 0; i < A.size(); i++) {
if (i > 0) {
cout << " ";
}
cout << A[i].suit << A[i].value;
}
cout << endl;
}
void bubbleSort(vector<Card>& A) {
for... | a.cc: In function 'void bubbleSort(std::vector<Card>&)':
a.cc:29:10: error: 'sw' was not declared in this scope
29 | return sw;
| ^~
|
s203215123 | p02261 | C++ | #include<iostream>
using namespase std;
syruct Card{char suit, value;} ;
void bubble(struct Card A[], int N){
for (int i = 0; i < N ; i++){
for (int j = N; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j]; A[j] = A[j - 1]; A[J -1] = t;
}
}
}
}
void selection(s... | a.cc:2:7: error: expected nested-name-specifier before 'namespase'
2 | using namespase std;
| ^~~~~~~~~
a.cc:4:1: error: 'syruct' does not name a type; did you mean 'struct'?
4 | syruct Card{char suit, value;} ;
| ^~~~~~
| struct
a.cc: In function 'void bubble(Card*, int)':
a.cc:9:14: er... |
s049028160 | p02261 | C++ | #include<iostream>
using namespase std;
struct Card{char suit, value;} ;
void bubble(struct Card A[], int N){
for (int i = 0; i < N ; i++){
for (int j = N; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j]; A[j] = A[j - 1]; A[J -1] = t;
}
}
}
}
void selection(s... | a.cc:2:7: error: expected nested-name-specifier before 'namespase'
2 | using namespase std;
| ^~~~~~~~~
a.cc: In function 'void bubble(Card*, int)':
a.cc:10:44: error: 'J' was not declared in this scope
10 | Card t = A[j]; A[j] = A[j - 1]; A[J -1] = t;
| ... |
s843602193 | p02261 | C++ | #include<iostream>
using namespase std;
struct Card{char suit, value; };
void bubble(struct Card A[], int N){
for (int i = 0; i < N ; i++){
for (int j = N - 1; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j]; A[j] = A[j - 1]; A[J -1] = t;
}
}
}
}
void selecti... | a.cc:2:7: error: expected nested-name-specifier before 'namespase'
2 | using namespase std;
| ^~~~~~~~~
a.cc: In function 'void bubble(Card*, int)':
a.cc:10:44: error: 'J' was not declared in this scope
10 | Card t = A[j]; A[j] = A[j - 1]; A[J -1] = t;
| ... |
s125613696 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{char suit, value; };
void bubble(struct Card A[], int N){
for (int i = 0; i < N ; i++){
for (int j = N - 1; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j]; A[j] = A[j - 1]; A[J -1] = t;
}
}
}
}
void selecti... | a.cc: In function 'void bubble(Card*, int)':
a.cc:10:44: error: 'J' was not declared in this scope
10 | Card t = A[j]; A[j] = A[j - 1]; A[J -1] = t;
| ^
a.cc: In function 'void selection(Card*, int)':
a.cc:22:48: error: expected primary-expression before '=' ... |
s224410193 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{char suit, value; };
void bubble(struct Card A[], int N){
for (int i = 0; i < N ; i++){
for (int j = N - 1; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void select... | a.cc: In function 'void selection(Card*, int)':
a.cc:22:48: error: expected primary-expression before '=' token
22 | Card t = A[i]; A[i] = A[minj]; A[minj]; = t;
| ^
a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:38:4: error: 'retrun' was not de... |
s633400206 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{char suit, value; };
void bubble(struct Card A[], int N){
for (int i = 0; i < N ; i++){
for (int j = N - 1; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void select... | a.cc: In function 'void selection(Card*, int)':
a.cc:22:48: error: expected primary-expression before '=' token
22 | Card t = A[i]; A[i] = A[minj]; A[minj]; = t;
| ^
a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:38:4: error: 'retrun' was not de... |
s057620020 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{char suit, value; };
void bubble(struct Card A[], int N){
for (int i = 0; i < N ; i++){
for (int j = N - 1; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void select... | a.cc: In function 'void selection(Card*, int)':
a.cc:22:48: error: expected primary-expression before '=' token
22 | Card t = A[i]; A[i] = A[minj]; A[minj]; = t;
| ^
a.cc: In function 'bool isStable(Card*, Card*, int)':
a.cc:38:4: error: 'retrun' was not de... |
s418962028 | p02261 | C++ | #include <stdio.h>
void bubbleSort(int *C, char *S, int N) {
for (int i=0; i<N; i++) {
for (int j=N-1; j>i; j--) {
if (C[j] < C[j-1]) {
int tn = C[j];
C[j] = C[j-1];
C[j-1] = tn;
char ts = S[j];
S[... | a.cc: In function 'void selectionSort(int*, char*, int)':
a.cc:21:9: error: 'minj' was not declared in this scope
21 | minj = i;
| ^~~~
a.cc: In function 'int checkCorrect(char*, char*, int)':
a.cc:44:5: error: 'check' was not declared in this scope
44 | check = 1;
| ^~~~~
a.cc... |
s958992301 | p02261 | C++ | #include <stdio.h>
void bubbleSort(int *C, char *S, int N) {
for (int i=0; i<N; i++) {
for (int j=N-1; j>i; j--) {
if (C[j] < C[j-1]) {
int tn = C[j];
C[j] = C[j-1];
C[j-1] = tn;
char ts = S[j];
S[... | a.cc: In function 'int main()':
a.cc:70:5: error: 'check' was not declared in this scope
70 | check=checkCorrect(s1, s2, n);
| ^~~~~
a.cc:72:30: error: expected ';' before 'return'
72 | else printf("Not stable")
| ^
| ;
73 ... |
s964664687 | p02261 | C++ | #include <stdio.h>
void bubbleSort(int *C, char *S, int N) {
for (int i=0; i<N; i++) {
for (int j=N-1; j>i; j--) {
if (C[j] < C[j-1]) {
int tn = C[j];
C[j] = C[j-1];
C[j-1] = tn;
char ts = S[j];
S[... | a.cc: In function 'int main()':
a.cc:70:5: error: 'check' was not declared in this scope
70 | check=checkCorrect(s1, s2, n);
| ^~~~~
|
s654217472 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++) {
for ( int j = N - 1; j >= i + 1: j-- ) {
if ( A[j].value < A[j - 1].value ) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
void selection(struct Card A[]... | a.cc:6:1: error: extended character is not valid in an identifier
6 | for ( int i = 0; i < N; i++) {
| ^
a.cc:7:1: error: extended character is not valid in an identifier
7 | for ( int j = N - 1; j >= i + 1: j-- ) {
| ^
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:... |
s073030194 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++) {
for ( int j = N - 1; j >= i + 1: j-- ) {
if ( A[j].value < A[j - 1].value ) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void selection(struct... | a.cc:6:1: error: extended character is not valid in an identifier
6 | for ( int i = 0; i < N; i++) {
| ^
a.cc:7:1: error: extended character is not valid in an identifier
7 | for ( int j = N - 1; j >= i + 1: j-- ) {
| ^
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:... |
s979169009 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N; i++) {
for ( int j = N - 1; j >= i + 1; j-- ) {
if ( A[j].value < A[j - 1].value ) {
Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
}
}
}
}
void selection(struc... | a.cc:7:1: error: extended character is not valid in an identifier
7 | for ( int i = 0; i < N; i++) {
| ^
a.cc:8:1: error: extended character is not valid in an identifier
8 | for ( int j = N - 1; j >= i + 1; j-- ) {
| ^
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:... |
s085602784 | p02261 | C++ | #include<iostream>
using namespase std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N){
for ( int i = 0; i < N; i++){
for(int j = N - 1; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j];
A[j] = A[j - 1];
A[j - 1] = t;
}
}
}
}
void selection(struct Ca... | a.cc:2:7: error: expected nested-name-specifier before 'namespase'
2 | using namespase std;
| ^~~~~~~~~
a.cc: In function 'void print(Card*, int)':
a.cc:32:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
32 | if( i > 0)cout << " ";
| ^~~~
| ... |
s597447171 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N){
for ( int i = 0; i < N; i++){
for(int j = N - 1; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j];
A[j] = A[j - 1];
A[j - 1] = t;
}
}
}
}
void selection(struct Ca... | a.cc: In function 'int main()':
a.cc:62:13: error: expected ';' before ':' token
62 | print(C2,N):
| ^
| ;
a.cc:66:3: error: 'else' without a previous 'if'
66 | else{
| ^~~~
a.cc:67:29: error: 'ebdl' was not declared in this scope
67 | cout << "Not Stable" << ... |
s596116355 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N){
for ( int i = 0; i < N; i++){
for(int j = N - 1; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j];
A[j] = A[j - 1];
A[j - 1] = t;
}
}
}
}
void selection(struct Ca... | a.cc: In function 'int main()':
a.cc:64:25: error: 'ebdl' was not declared in this scope
64 | cout << "Stable" << ebdl;
| ^~~~
a.cc:67:29: error: 'ebdl' was not declared in this scope
67 | cout << "Not Stable" << ebdl;
| ^~~~
|
s591934175 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
int i,j;
for(i=0;i<N;i++){
for(j=N-1;j<=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Car... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:10:15: error: 'struct Card' has no member named 'value'
10 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:10:28: ... |
s204276865 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
int i,j;
for(i=0;i<N;i++){
for(j=N-1;j<=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Car... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:10:15: error: 'struct Card' has no member named 'value'
10 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:10:28: ... |
s806917231 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
int i,j;
for(i=0;i<N;i++){
for(j=N-1;j<=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Car... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:10:15: error: 'struct Card' has no member named 'value'
10 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:10:28: ... |
s331041381 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
int i,j;
for(i=0;i<N;i++){
for(j=N-1;j<=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Car... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:10:15: error: 'struct Card' has no member named 'value'
10 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:10:28: ... |
s823494564 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
int i,j;
for(i=0;i<N;i++){
for(j=N-1;j<=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Car... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:10:15: error: 'struct Card' has no member named 'value'
10 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:10:28: ... |
s053488367 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
int i,j;
for(i=0;i<N;i++){
for(j=N-1;j<=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Car... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:10:15: error: 'struct Card' has no member named 'value'
10 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:10:28: ... |
s159563396 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
int i,j;
for(i=0;i<N;i++){
for(j=N-1;j<=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Car... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:10:15: error: 'struct Card' has no member named 'value'
10 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:10:28: ... |
s409296026 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
int i,j;
for(i=0;i<N;i++){
for(j=N-1;j<=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Car... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:10:15: error: 'struct Card' has no member named 'value'
10 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:10:28: ... |
s357707457 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Card C... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:9:15: error: 'struct Card' has no member named 'value'
9 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:9:28: er... |
s634270617 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card{ char suit; value;} ;
void bubbleSort(struct Card C[],int N){
for(int i=0;i<N;i++){
for(int j=N-1;j>=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selecitonSort(struct Card C... | a.cc:4:25: error: 'value' does not name a type
4 | struct Card{ char suit; value;} ;
| ^~~~~
a.cc: In function 'void bubbleSort(Card*, int)':
a.cc:9:15: error: 'struct Card' has no member named 'value'
9 | if(C[j].value<C[j-1].value){
| ^~~~~
a.cc:9:28: er... |
s372097363 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value;};
void bubbleSort(struct Card C[],int N){
for(int i=0; i<N; i++){
for(int j=N-1;j>=i+1;j--){
if(C[j].value<C[j-1].value){
Card t=C[j];
C[j]=C[j-1];
C[j-1]=t;
}
}
}
}
void selectionSort(struct Card C[],int N){
for(int... | a.cc:38:31: error: 'sturct' has not been declared
38 | bool hikaku(struct Card C1[], sturct Card C2[],int N){
| ^~~~~~
a.cc:38:43: error: expected ',' or '...' before 'C2'
38 | bool hikaku(struct Card C1[], sturct Card C2[],int N){
| ... |
s395813605 | p02261 | C++ | import copy
N = int(input())
A = list(input().split())
def is_stable(sorted_list):
for i in range(len(sorted_list)-1):
if sorted_list[i][1] == sorted_list[i+1][1]:
for j in range(len(A)):
if A[j] == sorted_list[i]:
smaller_idx = j
if A[j] == ... | a.cc:47:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
47 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
1 | import copy
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s122665075 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[],int N){
for(int i = 0; i < N; i++){
for(int j = N - 1; j >= i + 1; j--){
if(A[j].value < A[j - 1].value){
Card t = A[j];
A[j] = A[j - 1];
A[j - 1] = t;
}
}
}
}
void selection(struct Card ... | a.cc: In function 'int main()':
a.cc:47:3: error: expected initializer before 'int'
47 | int N;
| ^~~
a.cc:50:10: error: 'N' was not declared in this scope
50 | cin >> N;
| ^
a.cc:55:29: error: 'C2' was not declared in this scope; did you mean 'C1'?
55 | for(int i = 0; i < N; i++)C... |
s228540176 | p02261 | C++ | #include<iostream>
using namespace std;
struct Card{
char suit;
int value;
};
void bubbleSort(card c[],int n){
int flag=1;
for(int i=0;i<n-1;++i){
if(!flag)break;
flag=0;
for(int j=n-1;j>i;j--){
if(a[j]<a[j-1]){
flag=1;
card t=a[j];
... | a.cc:9:6: error: variable or field 'bubbleSort' declared void
9 | void bubbleSort(card c[],int n){
| ^~~~~~~~~~
a.cc:9:17: error: 'card' was not declared in this scope; did you mean 'Card'?
9 | void bubbleSort(card c[],int n){
| ^~~~
| Card
a.cc:9:26: error... |
s237750452 | p02261 | C++ | #include<iostream>
using namespace std;
struct card{
char suit;
int value;
};
void bubbleSort(card c[],int n){
int flag=1;
for(int i=0;i<n-1;++i){
if(!flag)break;
flag=0;
for(int j=n-1;j>i;j--){
if(a[j]<a[j-1]){
flag=1;
card t=a[j];
... | a.cc: In function 'void bubbleSort(card*, int)':
a.cc:15:16: error: 'a' was not declared in this scope
15 | if(a[j]<a[j-1]){
| ^
a.cc: In function 'void selectionSort(card*, int)':
a.cc:30:16: error: 'a' was not declared in this scope
30 | if(a[j]<a[min])
| ... |
s879311601 | p02261 | C++ | #include<iostream>
using namespace std;
struct card{
char suit;
int value;
};
void bubbleSort(card a[],int n){
int flag=1;
for(int i=0;i<n-1;++i){
if(!flag)break;
flag=0;
for(int j=n-1;j>i;j--){
if(a[j]<a[j-1]){
flag=1;
card t=a[j];
... | a.cc: In function 'void bubbleSort(card*, int)':
a.cc:15:20: error: no match for 'operator<' (operand types are 'card' and 'card')
15 | if(a[j]<a[j-1]){
| ~~~~^~~~~~~
| | |
| card card
In file included from /usr/include/c++/14/st... |
s312879882 | p02261 | C++ | #include<iostream>
using namespace std;
struct card{
char suit;
int value;
};
void bubbleSort(card a[],int n){
int flag=1;
for(int i=0;i<n-1;++i){
if(!flag)break;
flag=0;
for(int j=n-1;j>i;j--){
if(a[j].value<a[j-1].value){
flag=1;
ca... | a.cc:37:34: error: expected ')' before ';' token
37 | bool isStable(card c1[],card c2[];int n){
| ~ ^
| )
a.cc:37:40: error: expected initializer before ')' token
37 | bool isStable(card c1[],card c2[];int n){
| ... |
s643459198 | p02261 | C++ | #include<iostream>
using namespace std;
struct card{
char suit;
int value;
};
void bubbleSort(card a[],int n){
int flag=1;
for(int i=0;i<n-1;++i){
if(!flag)break;
flag=0;
for(int j=n-1;j>i;j--){
if(a[j].value<a[j-1].value){
flag=1;
ca... | a.cc: In function 'bool isStable(card*, card*, int)':
a.cc:39:15: error: no match for 'operator!=' (operand types are 'card' and 'card')
39 | if(c1[i]!=c2[i])return false;
| ~~~~~^~~~~~~
| | |
| card card
In file included from /usr/include/c++/14/iosf... |
s547951983 | p02261 | C++ | #include<iostream>
using namespace std;
struct card{
char suit;
int value;
};
void bubbleSort(card a[],int n){
int flag=1;
for(int i=0;i<n-1;++i){
if(!flag)break;
flag=0;
for(int j=n-1;j>i;j--){
if(a[j].value<a[j-1].value){
flag=1;
ca... | a.cc: In function 'int main()':
a.cc:55:17: error: request for member 'suit' in 'c1', which is of non-class type 'card [36]'
55 | cin>>c1.suit>>c1.value;
| ^~~~
a.cc:55:26: error: request for member 'value' in 'c1', which is of non-class type 'card [36]'
55 | cin>>c1.suit>>c1... |
s560686881 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N ; i++ ){
for (int j = N - 1; j >= i + 1; j-- ){
if(A[j].value < A[j-1].value){
Card t = A[i]; A[i] = A[j-1]; A[j-1] = t;
}
... | a.cc: In function 'void selection(Card*, int)':
a.cc:23:9: error: 'card' was not declared in this scope; did you mean 'Card'?
23 | card t = A[i]; A[i]=A[minj]; A[minj]=t;
| ^~~~
| Card
a.cc:23:46: error: 't' was not declared in this scope
23 | card t = A[i]; A[i]=A[minj... |
s077563292 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N ; i++ ){
for (int j = N - 1; j >= i + 1; j-- ){
if(A[j].value < A[j-1].value){
Card t = A[j]; A[j] = A[j-1]; A[j-1] = t;
}
... | a.cc: In function 'void selection(Card*, int)':
a.cc:23:9: error: 'card' was not declared in this scope; did you mean 'Card'?
23 | card t = A[i]; A[i]=A[minj]; A[minj]=t;
| ^~~~
| Card
a.cc:23:46: error: 't' was not declared in this scope
23 | card t = A[i]; A[i]=A[minj... |
s993575217 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N ; i++ ){
for (int j = N - 1; j >= i + 1; j-- ){
if(A[j].value < A[j-1].value){
Card t = A[j]; A[j] = A[j-1]; A[j-1] = t;
}
... | a.cc: In function 'void selection(Card*, int)':
a.cc:23:9: error: 'card' was not declared in this scope; did you mean 'Card'?
23 | card t = A[i]; A[i] = A[minj]; A[minj]=t;
| ^~~~
| Card
a.cc:23:48: error: 't' was not declared in this scope
23 | card t = A[i]; A[i] = A[... |
s836221861 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N ; i++ ){
for (int j = N - 1; j >= i + 1; j-- ){
if(A[j].value < A[j-1].value){
Card t = A[j]; A[j] = A[j-1]; A[j-1] = t;
}
... | a.cc: In function 'void selection(Card*, int)':
a.cc:23:9: error: 'card' was not declared in this scope; did you mean 'Card'?
23 | card t = A[i]; A[i] = A[minj]; A[minj]=t;
| ^~~~
| Card
a.cc:23:48: error: 't' was not declared in this scope
23 | card t = A[i]; A[i] = A[... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.