submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s013392138 | p00049 | C++ | #include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main(){
int num;int blood_a=0,blood_b=0,blood_ab=0,blood_o=0;
char blood_type[3];
while(scanf("%d,%s",&num,blood_type)){
if(blood_type=='A')blood_a++;
else if(blood_type='B')blood_b++;
else if(blood_type="AB")blood_a... | a.cc: In function 'int main()':
a.cc:10:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(blood_type=='A')blood_a++;
| ~~~~~~~~~~^~~~~
a.cc:11:25: error: incompatible types in assignment of 'char' to 'char [3]'
11 | else if(blood_type='B')blood_b++... |
s417867025 | p00049 | C++ | #include <cstdio>
using namespace std;
int main() {
int A=0,B=0,C=0,D=0;
int num;
char bl;
while (scanf("%d, %c",num,bl)!=EOF) {
switch(bl) {
case 'A':
A++;
break;
case 'B';
B++;
break;
case 'AB':
AB++;
break;
case 'O':
O++;
break;
}
}
printf("%d\n%d\n%d\n%d\n",A,B... | a.cc:16:30: warning: multi-character character constant [-Wmultichar]
16 | case 'AB':
| ^~~~
a.cc: In function 'int main()':
a.cc:13:33: error: expected ':' before ';' token
13 | case 'B';
| ^
... |
s503161216 | p00049 | C++ | #include <cstdio>
#include <string>
using namespace std;
int main() {
int A=0,B=0,C=0,D=0;
int num;
string bl;
while (scanf("%d, %s",num,bl)!=EOF) {
switch(bl) {
case "A":
A++;
break;
case "B":
B++;
break;
case "AB":
C++;
break;
case "O":
D++;
break;
}
}
printf("%d... | a.cc: In function 'int main()':
a.cc:10:24: error: switch quantity not an integer
10 | switch(bl) {
| ^~
|
s090510355 | p00049 | C++ | char a[999],b,c[9];
main(){for(;scanf("%d,%s",&b,c)+1;a[*c+c[1]]++);printf("%d\n%d\n%d\n%d\n",a[65],a[66],a[131],a[79]);} | a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){for(;scanf("%d,%s",&b,c)+1;a[*c+c[1]]++);printf("%d\n%d\n%d\n%d\n",a[65],a[66],a[131],a[79]);}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:13: error: 'scanf' was not declared in this scope
2 | main(){for(;sc... |
s266244616 | p00049 | C++ | char s[9];a[4];main(i){for(;~scanf("%*d,%s");)a[*s-65?*s-66?2:3:s[1]?4:1]++;for(;i<5;)printf("%d\n",a[i]);return 0;} | a.cc:1:11: error: 'a' does not name a type
1 | char s[9];a[4];main(i){for(;~scanf("%*d,%s");)a[*s-65?*s-66?2:3:s[1]?4:1]++;for(;i<5;)printf("%d\n",a[i]);return 0;}
| ^
a.cc:1:20: error: expected constructor, destructor, or type conversion before '(' token
1 | char s[9];a[4];main(i){for(;~scanf("... |
s718642790 | p00049 | C++ | c[];main(b){for(;~scanf("%d%s",&b,&b);++c[b%9]);printf("%d\n%d\n%d\n%d\n",c[7],c[2],c[1],*c);} | a.cc:1:1: error: 'c' does not name a type
1 | c[];main(b){for(;~scanf("%d%s",&b,&b);++c[b%9]);printf("%d\n%d\n%d\n%d\n",c[7],c[2],c[1],*c);}
| ^
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token
1 | c[];main(b){for(;~scanf("%d%s",&b,&b);++c[b%9]);printf("%d\n%d\n%d\n%d... |
s996269708 | p00049 | C++ | main(a,b,c,d,e){printf("%d\n%d\n%d\n%d\n",b%10,c%10,d%10,e%10);} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(a,b,c,d,e){printf("%d\n%d\n%d\n%d\n",b%10,c%10,d%10,e%10);}
| ^
|
s477971037 | p00049 | C++ | x;main(){x=!puts("10\n6\n10\n0");} | a.cc:1:1: error: 'x' does not name a type
1 | x;main(){x=!puts("10\n6\n10\n0");}
| ^
a.cc:1:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | x;main(){x=!puts("10\n6\n10\n0");}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:10: error: 'x' was not declared in this sc... |
s300148806 | p00049 | C++ | main(){printf("10\n6\n10\n0");} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){printf("10\n6\n10\n0");}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'printf' was not declared in this scope
1 | main(){printf("10\n6\n10\n0");}
| ^~~~~~
a.cc:1:1: note: 'printf' is de... |
s950645415 | p00049 | C++ | a;main(){a=!puts("10\n6\n10\n0");} | a.cc:1:1: error: 'a' does not name a type
1 | a;main(){a=!puts("10\n6\n10\n0");}
| ^
a.cc:1:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a;main(){a=!puts("10\n6\n10\n0");}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:10: error: 'a' was not declared in this sc... |
s044527451 | p00049 | C++ | #include<cstdio>
using namespace std;
int answer[4]={0};
int main()
{
int n;
char c[4];
while(scanf("%d,%s",&n,c)!=EOF)
{
if(c=="A") answer[0]++;
if(c=="B")answer[1]++;
if(c=="AB")answer[2]++;
if(c=="O")answer[3]++;
}
for(int i=0;i<4;i++)
{
printf("%d\n",answer[i]):;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:20:41: error: expected ';' before ':' token
20 | printf("%d\n",answer[i]):;
| ^
| ;
|
s477507425 | p00049 | C++ | #include <iostream>
using namespace std;
int main()
{
int x,y,z,a,b,ab,o;
char w,v,q;
while(cin>>x>>w>>v)
{
if(v == A)a++;
else if(v==B){b++;}
else if(v==AB){ab++;}
else (v==o){o++;}
}
cout<<a<<endl;
cout<<b<<endl;
cout<<ab<<endl;
cout<<o<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:11: error: 'A' was not declared in this scope
10 | if(v == A)a++;
| ^
a.cc:11:14: error: 'B' was not declared in this scope
11 | else if(v==B){b++;}
| ^
a.cc:12:14: error: 'AB' was not declared in this scope; did you mean 'ab'?
12 |... |
s117693227 | p00049 | C++ | #include <iostream>
using namespace std;
int main()
{
int x,y,z,a,b,ab,o;
char w,v,q;
while(cin>>x>>w>>v)
{
if(v == A;)a++;
else if(v==B;){b++;}
else if(v==AB;){ab++;}
else (v==o;){o++;}
}
cout<<a<<endl;
cout<<b<<endl;
cout<<ab<<endl;
cout<<o<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:11: error: 'A' was not declared in this scope
10 | if(v == A;)a++;
| ^
a.cc:10:13: error: expected primary-expression before ')' token
10 | if(v == A;)a++;
| ^
a.cc:11:14: error: 'B' was not declared in this scope
11 | else if(v==B... |
s449239726 | p00049 | C++ | #include <iostream>
using namespace std;
 
int main() {
  
  int a = 0, b = 0, ab = 0, o = 0,x;
char q,s;
  while(cin>>x>>q>>s)
{
    if (s == "A") {
      a++;
    } else if (s == "B") {
    ... | a.cc:4:2: error: stray '#' in program
4 |  
| ^
a.cc:6:2: error: stray '#' in program
6 |   
| ^
a.cc:6:8: error: stray '#' in program
6 |   
| ^
a.cc:7:2: error: stray '#' in program
7 |   int a = 0, b = 0, ab = 0, o = 0,x;
| ^
a.cc:7... |
s260654662 | p00049 | C++ | #include <iostream>
#include <string>
using namespace std;
 
int main() {
  string str;
  int a = 0, b = 0, ab = 0, o = 0;
  while (getline(cin, str)) {
    string s = str.substr(str.find_first_of(",")+1);
    if (s == "A") {
   &... | a.cc:4:2: error: stray '#' in program
4 |  
| ^
a.cc:6:2: error: stray '#' in program
6 |   string str;
| ^
a.cc:6:8: error: stray '#' in program
6 |   string str;
| ^
a.cc:7:2: error: stray '#' in program
7 |   int a = 0, b = 0, ab = 0, o = ... |
s182381585 | p00049 | C++ | #include <iostream>
#include <string>
using namespace std;
 
int main() {
  string str;
  int a = 0, b = 0, ab = 0, o = 0;
  while (getline(cin, str)) {
    string s = str.substr(str.find_first_of(",")+1);
    if (s == "A") {
   &... | a.cc:4:2: error: stray '#' in program
4 |  
| ^
a.cc:6:2: error: stray '#' in program
6 |   string str;
| ^
a.cc:6:8: error: stray '#' in program
6 |   string str;
| ^
a.cc:7:2: error: stray '#' in program
7 |   int a = 0, b = 0, ab = 0, o = ... |
s526862296 | p00049 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
int a = 0, b = 0, ab = 0, o = 0;
while (getline(cin, str)) {
string s = str.substr(str.find_first_of(",")+1);
if (s == "A") {
a++;
} else if (s == "B") {
b++;
} else if (s == "O") {
o++;
} e... | a.cc:22:3: error: expected declaration before '}' token
22 | };}
| ^
|
s842132084 | p00049 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <map>
using namespace std;
int main() {
int num;
string row, blood;
map<string, int> type;
type.insert(make_pair("A", 0));
type.insert(make_pair("B", 0));
type.insert(make_pair("O", 0));
type.insert(make_pair("AB", 0));
while(cin>>row, !cin.eof(... | a.cc: In function 'int main()':
a.cc:17:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
17 | sscanf(row,"%d,%s", &num, &blood)
| ^~~
| |
| std::string {aka std::__c... |
s216536970 | p00049 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <map>
using namespace std;
int main() {
int num;
string row, blood;
map<string, int> type;
type.insert(make_pair("A", 0));
type.insert(make_pair("B", 0));
type.insert(make_pair("O", 0));
type.insert(make_pair("AB", 0));
while(cin>>row, !cin.eof(... | a.cc: In function 'int main()':
a.cc:17:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
17 | sscanf(row,"%d,%s", &num, &blood);
| ^~~
| |
| std::string {aka std::__... |
s627146839 | p00049 | C++ | #include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main(){
char blood[3];
int num,a=0,b=0,o=0,ab=0;
while(scanf("%d,%s",&num,blood) != EOF){
if(blood[0] == 'A' && blood[1] == '\0'){
a++;
}
else if(blood[0] == 'B'){
b++;
}
else if(blood[0] == 'O'){
... | a.cc: In function 'int main()':
a.cc:19:13: error: 'strcmp' was not declared in this scope
19 | else if(strcmp(blood,"AB") == 0){
| ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cstdio>
+++ |+#includ... |
s158423379 | p00050 | Java | import java.io.*;
public class Main {
public Main() {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
System.out.println(str.replace("apple", "xxxxx").replace("peach", "apple").replace("xxxxx", "peach"));
br.close()
} catch(I... | Main.java:9: error: ';' expected
br.close()
^
1 error
|
s788960455 | p00050 | Java | import java.util.Scanner;
public class Main{
????????????public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
str = str.replaceAll("apple", "aaaaa");
str = str.replaceAll("peach", "apple");
str = str.replaceAll("aaaaa", "peach");
System.out.println(str);
... | Main.java:3: error: illegal start of type
????????????public static void main(String[] args) {
^
1 error
|
s316209633 | p00050 | Java | import java.util.*;
class Main{
????????????public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
str = str.replaceAll("apple", "aaaaa");
str = str.replaceAll("peach", "apple");
str = str.replaceAll("aaaaa", "peach");
System.out.println(str);
}
} | Main.java:3: error: illegal start of type
????????????public static void main(String[] args) {
^
1 error
|
s848869696 | p00050 | Java | /*
正規表現は、[〇〇]を文字列形式で与える!!
*/
import java.util.*;
public class Main0050{
static Scanner kbd = new Scanner(System.in);
public static void main(String[] args){
String s = ""; // 生成中単語
String x; // 取得1文字
String sent = ""; // 出力文章
String in = kbd.nextLine(); // 入力文章
int i;
for(i=0; i<in.lengt... | Main.java:5: error: class Main0050 is public, should be declared in a file named Main0050.java
public class Main0050{
^
1 error
|
s649852201 | p00050 | Java | import java.util.*;
public class Main{
Scanner kbd = new Scanner(System.in);
public static void main(String[] args){
new Main0050().run();
}
void run(){
while(kbd.hasNext()){
String x; // 取得1文字
StringBuffer sent = new StringBuffer(); // 出力文章
String in = kbd.nextLine(); // 入力文... | Main.java:5: error: cannot find symbol
new Main0050().run();
^
symbol: class Main0050
location: class Main
1 error
|
s519033354 | p00050 | Java | public class AppleAndPeach {
public static void main(String args[]) throws Exception {
System.out.println("input letters >");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = br.readLine();
String output = input.replaceAll("peach","value");
... | Main.java:1: error: class AppleAndPeach is public, should be declared in a file named AppleAndPeach.java
public class AppleAndPeach {
^
Main.java:6: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class AppleAn... |
s486573623 | p00050 | Java | public class Main {
public static void main(String args[]) throws Exception {
System.out.println("input letters >");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = br.readLine();
String output = input.replaceAll("peach","value");
... | Main.java:6: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:6: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
... |
s454872222 | p00050 | Java | public class Main {
public static void Main(String args[]) throws Exception {
System.out.println("input letters >");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = br.readLine();
String output = input.replaceAll("peach","value");
... | Main.java:6: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:6: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
... |
s636924777 | p00050 | Java | public class main {
public static void main(String args[]) throws Exception {
BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0; i<Integer.parseInt(bn.readLine()); i++){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
line = br.... | Main.java:1: error: class main is public, should be declared in a file named main.java
public class main {
^
Main.java:3: error: cannot find symbol
BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class main
Main.java:3: error: cannot fi... |
s460359712 | p00050 | Java | public class Main {
public static void main(String args[]) {
BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0; i<Integer.parseInt(bn.readLine()); i++){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
line = br.readLine();
St... | Main.java:3: error: cannot find symbol
BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:3: error: cannot find symbol
BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
^
... |
s643283218 | p00050 | Java | public static void Main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
sentence = br.readLine();
sentence = sentence.replaceAll("peach","リンゴ");
sentence = sentence.replaceAll("apple","peach");
sentence = sentence.replaceAll("リンゴ"... | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void Main(String args[]) throws Exception {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s153301509 | p00050 | Java | public class Main {
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line=br.readLine();
line = line.replace("apple","fujita-");
line = line.replace("peach","ikeda-");
line = line.replace("fujita-","peach");
line = l... | Main.java:4: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:4: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
... |
s933022292 | p00050 | Java | public class Main {
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
line = br.readLine();
String str1 = line.replaceAll("apple", "テンプ");
String str2 = str1.replaceAll("peach", "apple");
String str3 = str2.repla... | Main.java:3: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:3: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
... |
s154669728 | p00050 | Java | public class Main {
private static String sentence;
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
sentence = br.readLine();
sentence = sentence.replaceAll("peach","リンゴ");
... | Main.java:5: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:5: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
... |
s502073222 | p00050 | Java | package tips;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class AandP {
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
line = line.replaceAll... | Main.java:6: error: class AandP is public, should be declared in a file named AandP.java
public class AandP {
^
1 error
|
s426555911 | p00050 | C | #include <stdio.h>
int main(void){
char str[1000];
int i;
int l;
scanf("%s",str));
l=strlen(str);
for(i=0;i<=l;i++){
if(str[i]=='a' && str[i+1]=='p' && str[i+2]=='p' && str[i+3]=='l' && str[i+4]=='e'){
str[i]='p';
str[i+1]='e';
str[i+2]='a';
str[i+3]='c';
str[i+4]='h';
}
else if(str[i]=='p' &... | main.c: In function 'main':
main.c:6:24: error: expected ';' before ')' token
6 | scanf("%s",str));
| ^
| ;
main.c:6:24: error: expected statement before ')' token
main.c:7:11: error: implicit declaration of function 'strlen' [-Wimplicit-function-dec... |
s823084277 | p00050 | C | // AOJ Volume 0 Problem 0050
#include <stdio.h>
#include <string.h>
int main(void)
{
char str_in[2000];
char str_out[2000];
char *p_in, *p_out;
gets(str_in, 2000, stdin);
str_out[0] = '\0';
p_in = str_in;
p_out = str_out;
while (*p_in != '\0'){
if (strncmp(p_in, "apple",... | main.c: In function 'main':
main.c:12:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
12 | gets(str_in, 2000, stdin);
| ^~~~
| fgets
|
s833319545 | p00050 | C | package solve;
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String str = "" , all = "";
boolean Eflag = false;
while ( sc.hasNext() ) {
str = sc.next();
String tmp = "";
char c;
for ( int i = 0; i < str.length(); i++ ) {
c... | main.c:1:1: error: unknown type name 'package'
1 | package solve;
| ^~~~~~~
main.c:2:1: error: unknown type name 'import'
2 | import java.util.*;
| ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
2 | import java.util.*;
| ^
main.c:4:1... |
s828506191 | p00050 | C | #include<stdio.h>
int main()
{
char str[1000];
int i=0;
gets(str);
while(str[i+4]!='\0')
{
if(str[i]=='a')
{
if(str[i+1]=='p')
{
if(str[i+2]=='p')
{
if(str[i+3]=='l')
{
if(str[i+4]=='e')
{
str[i]='p';
str[i+1]='e';
str[i+2]='a';
str[i+3]='c';... | main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
8 | gets(str);
| ^~~~
| fgets
|
s020446527 | p00050 | C | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
while(true){
String data = scan.next();
if(data.equals("apple")){
System.out.print("peach ");
}else if(data.equals("peach")){
System.out.print("apple ");
}else{
int l... | main.c:1:1: error: unknown type name 'import'
1 | import java.util.Scanner;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.Scanner;
| ^
main.c:3:1: error: unknown type name 'class'
3 | class Main{
| ^~~~~
main.... |
s595016883 | p00050 | C | int main(void){
char text[100],punc;
int i=0,j,n;
while(scanf("%s",text)!=EOF){
n=strlen(text);punc=0;
if(ispunct(text[n-1])){punc=text[n-1];text[n-1]='\0';}
if(strcmp(text,"apple")==0)strcpy(text,"peach");
else if(strcmp(text,"apples")==0)strcpy(text,"peaches");
else if(strcmp(text,"Apple")==0)strcpy(tex... | main.c: In function 'main':
main.c:4:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | while(scanf("%s",text)!=EOF){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(void)... |
s781788393 | p00050 | C | int main(void){
char text[1024];
int i,n;
fgets(text,1024,stdin);
n=strlen(text);
for(i=0;i<n-5;i++){
if((isspace(text[i]) || ispunct(text[i])) && (isspace(text[i+6]) || ispunct(text[i+6]))){
i++;
if(text[i]=='a' && text[i+1]=='p' && text[i+2]=='p' && text[i+3]=='l' && text[i+4]=='e'){
text[i]='p';text... | main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
4 | fgets(text,1024,stdin);
| ^~~~~
main.c:4:25: error: 'stdin' undeclared (first use in this function)
4 | fgets(text,1024,stdin);
| ... |
s780543584 | p00050 | C | int main(void){
char text[1024];
int i,n;
fgets(text,1024,stdin);
n=strlen(text);
for(i=0;i<n-5;i++){
if((isspace(text[i]) || ispunct(text[i])) && (isspace(text[i+6]) || ispunct(text[i+6]))){
i++;
if(text[i]=='a' && text[i+1]=='p' && text[i+2]=='p' && text[i+3]=='l' && text[i+4]=='e'){
text[i]='p';text... | main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
4 | fgets(text,1024,stdin);
| ^~~~~
main.c:4:25: error: 'stdin' undeclared (first use in this function)
4 | fgets(text,1024,stdin);
| ... |
s705924965 | p00050 | C | #include <stdio.h>
int problem0050(){
int start_apple[200],start_peach[200],flag1=0,flag2=0,judge1=0,judge2=0,i,j,k;
char alternative[]="pop'n";
char apple[]="apple";
char peach[]="peach";
char buf[1001];
fgets(buf,1000,stdin);
for(i=0;i<996;i++){
for(j=0;j<5;j++){
if(buf[i+j]==apple[j]){judge1++;}
if(b... | /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
|
s782266137 | p00050 | C | #include <stdio.h>
#include <string.h>
int main(){
char str[2000];
int i, j;
fgets(str, 2000, stdin);
for(i = 0;i < strlen(str);i++){
if(strncmp(&str[i], "apple", 5) == 0)strncpy(&str[i], "peach", 5);
else if(strncmp(&str[i], "peach", 5) == 0) strncpy(&str[i],"apple", 5);
printf("%s ", str);
}
... | main.c: In function 'main':
main.c:13:3: error: too many arguments to function 'puts'
13 | puts("%s", str);
| ^~~~
In file included from main.c:1:
/usr/include/stdio.h:714:12: note: declared here
714 | extern int puts (const char *__s);
| ^~~~
|
s098555980 | p00050 | C | int main(void)
{
char str[1000];
const char *apple = "apple";
const char *peach = "peach";
int i;
fgets(str, 1000, stdin);
for (i = 0; str[i] != 0; i++){
if (strncmp(&str[i], apple, 5) == 0){
strncpy(str + i, peach, 5);
}
else if (strncmp(&str[i], peach, 5) == 0){
strncpy(str + i, apple, 5);
}
}
... | main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
8 | fgets(str, 1000, stdin);
| ^~~~~
main.c:8:26: error: 'stdin' undeclared (first use in this function)
8 | fgets(str, 1000, stdin);
| ... |
s983660557 | p00050 | C | #include<stdio.h>
int main(void){
int i,j,n,m;
char a[1000];
gets(a);
for(i=0;i<1000;i++){
int f=0;
if(a[i]=='p'
if(a[i+1]=='e')if(a[i+2]=='a')if(a[i+3]=='c')a[i+4]=='h')f=1;
if(f==1){
a[i]='a';
a[i+1]='p';
a[i+2]='p';
a[i+3]='l';
a[i+4]=... | main.c: In function 'main':
main.c:5:4: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
5 | gets(a);
| ^~~~
| fgets
main.c:8:19: error: expected ')' before 'if'
8 | if(a[i]=='p'
| ~ ^
| ... |
s842199313 | p00050 | C++ | #include "pch.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
string x;
string a = "apple";
string b = "peach";
string c = "apple.";
string d = "peach.";
cin >> x;
if (x == a) { string x = "peach"; }
if (x == b) { string x = "apple"; }
if (x == c) { string x = "peach."; }
if (x =... | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s968876540 | p00050 | C++ | #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
int main(){
char input[1001];
cin.getline(input, 1000);
for (int i = 0; input[i] != '\n'; i++){
if (!strncmp(&input[i], "apple", 5)){
strncpy(&input[i], "peach", 5);
}
else if (!strncmp(&input[i], "peach", 5)){
... | a.cc: In function 'int main()':
a.cc:11:22: error: 'strncmp' was not declared in this scope
11 | if (!strncmp(&input[i], "apple", 5)){
| ^~~~~~~
a.cc:5:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #incl... |
s084629459 | p00050 | C++ | #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
int main(){
char input[2000];
cin.getline(input, 1000);
for (int i = 0; input[i] != '\0'; i++){
if (!strncmp(&input[i], "apple", 5)){
strncpy(&input[i], "peach", 5);
}
else if (!strncmp(&input[i], "peach", 5)){
... | a.cc: In function 'int main()':
a.cc:11:22: error: 'strncmp' was not declared in this scope
11 | if (!strncmp(&input[i], "apple", 5)){
| ^~~~~~~
a.cc:5:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #incl... |
s034970726 | p00050 | C++ | int main() {
string str;
getline(cin, str);
stringstream ss(str);
while (!ss.eof()) {
ss >> str;
int n = str.length() - 1;
char last = str[n];
if (!isalpha(last)) {
str.erase(n);
}
... | a.cc: In function 'int main()':
a.cc:2:9: error: 'string' was not declared in this scope
2 | string str;
| ^~~~~~
a.cc:3:17: error: 'cin' was not declared in this scope
3 | getline(cin, str);
| ^~~
a.cc:3:22: error: 'str' was not declared in this scope; did yo... |
s781998158 | p00050 | C++ | #include <iostream>
#include <string>
#include <sstream>
#include <regex>
using namespace std;
int main() {
string str;
getline(cin, str);
stringstream ss(str);
while (!ss.eof()) {
ss >> str;
string tmp = "";
tmp = regex_replace(str,"apple", "peach");
if (str == tmp) {
tmp = regex_replace(str, "peach... | a.cc: In function 'int main()':
a.cc:17:36: error: no matching function for call to 'regex_replace(std::string&, const char [6], const char [6])'
17 | tmp = regex_replace(str,"apple", "peach");
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14... |
s304082642 | p00050 | C++ | #include <iostream>
#include <string>
#include <sstream>
#include <regex>
using namespace std;
int main() {
string str;
getline(cin, str);
stringstream ss(str);
while (!ss.eof()) {
ss >> str;
string tmp = "";
tmp = regex_replace(str,"apple", "peach");
if (str == tmp) {
tmp = regex_replace(str, "peach... | a.cc: In function 'int main()':
a.cc:17:36: error: no matching function for call to 'regex_replace(std::string&, const char [6], const char [6])'
17 | tmp = regex_replace(str,"apple", "peach");
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14... |
s590529362 | p00050 | C++ | #include<iostream>
#include<string>
int main(){
string n;
while(cin>>n){
if(n=="peach")cout<<"apple"
else if(n=="apple")cout<<"peach";
else cout<<n;
if(n[n.size()-1]=='.')cout<<endl;
else cout<<" ";
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
4 | string n;
| ^~~~~~
a.cc:4:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
... |
s220358042 | p00050 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string n;
while(cin>>n){
if(n=="peach")cout<<"apple"
else if(n=="apple")cout<<"peach";
else cout<<n;
if(n[n.size()-1]=='.')cout<<endl;
else cout<<" ";
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:28: error: expected ';' before 'else'
7 | if(n=="peach")cout<<"apple"
| ^
| ;
8 | else if(n=="apple")cout<<"peach";
| ~~~~
|
s259721947 | p00050 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
int main(){... | a.cc: In function 'int main()':
a.cc:23:12: error: 't' was not declared in this scope
23 | i+=t;
| ^
|
s056099745 | p00050 | C++ | ans = gets.chomp.split(/([' '.])/).map(&:to_s).map{ |s|
if s == 'apple'
s = 'peach'
elsif s == 'peach'
s = 'apple'
else
s = s
end
}.join('')
puts ans | a.cc:2:17: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
2 | if s == 'apple'
| ^~~~~~~
a.cc:3:21: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
3 | s = 'peach'
| ^~~~~~~
... |
s295364890 | p00050 | C++ | str = gets.gsub(/apple/, 'spade')
str.gsub!(/peach/, 'apple')
str.gsub!(/spade/, 'peach')
puts str | a.cc:1:26: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
1 | str = gets.gsub(/apple/, 'spade')
| ^~~~~~~
a.cc:2:20: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
2 | str.gsub!(/peach/, 'apple')
| ... |
s082805801 | p00050 | C++ | #include<stdio.h>
#include<iostream>
#include<string>
using namespace std;
int main(){
string st;
string app="apple";
string pea="peach";
string t;
bool f=false;
while(cin>>st){
if(st.size()>=5)
{
if(f==true)cout<<" ";
for(int i=0;i<5;i++)
t[i]=st[i];
if(t=="apple"){
for(int i=0;i<5;i++)
st[i]=pea[i];
}
cout<<st;
f... | a.cc: In function 'int main()':
a.cc:26:3: error: 'truel' was not declared in this scope
26 | f=truel;
| ^~~~~
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s101866899 | p00050 | C++ | #include<stdio.h>
int main(){
char cx[1024];
char px[10]="peach",ax[10]="apple";
char y[6];
while(scanf("%s",cx)!=EOF){
for(int i=0;i<5;i++){
y[i]=cx[i];
}
if(y[0]=='p'&&y[1]=='e'&&y[2]=='a'&&y[3]=='c'&&y[4]=='h'){
for(int i=0;i<5;i++)
cx[i]=ax[i];
else if(y[0]=='a'&&y[1]=='p'&&y[2]=='p'&&y[3]=='l'&&y[4]=='e'){
f... | a.cc: In function 'int main()':
a.cc:19:1: error: expected '}' before 'else'
19 | else if(y[0]=='a'&&y[1]=='p'&&y[2]=='p'&&y[3]=='l'&&y[4]=='e'){
| ^~~~
a.cc:15:58: note: to match this '{'
15 | if(y[0]=='p'&&y[1]=='e'&&y[2]=='a'&&y[3]=='c'&&y[4]=='h'){
| ... |
s516150752 | p00050 | C++ | #include <cstdio>
using namespace std;
int main(){
char str[1000];
char app[5] = "apple", pea[5] = "peach";
bool output, first;
first = true;
while((scanf("%s", str)) != EOF){
output = false;
if(!first) printf(" ");
first = false;
for(int i = 0; i < 5; i++){
if(app[i] != str[i]) break;
i... | a.cc: In function 'int main()':
a.cc:6:23: error: initializer-string for 'char [5]' is too long [-fpermissive]
6 | char app[5] = "apple", pea[5] = "peach";
| ^~~~~~~
a.cc:6:41: error: initializer-string for 'char [5]' is too long [-fpermissive]
6 | char app[5] = "appl... |
s286517136 | p00050 | C++ | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner input=new Scanner(System.in);
String str;
String res="";
while(input.hasNext()){
str=input.next();
for(int i=0;i<str.length()-4;i++){
if((str.substring(i,i+5)).equals("apple"))
str=str.replaceAll("app... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s360064087 | p00050 | C++ | #include<iostream>
#include<strring>
using namespace std;
int main() {
string s;
getline(cin, s);
string::size_type pos1,pos2, begin;
while(1){
pos1 = s.find("apple", begin);
pos2 = s.find("peach", begin);
if( pos1 == string::npos && pos2 == string::npos )
break;
if( pos1 < pos2 ){
s.replac... | a.cc:2:9: fatal error: strring: No such file or directory
2 | #include<strring>
| ^~~~~~~~~
compilation terminated.
|
s581318533 | p00050 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string s;
getline(cin, s);
string::size_type pos1,pos2, begin;
while(1){
pos1 = s.find("apple", begin);
pos2 = s.find("peach", begin);
if( pos1 == string::npos && pos2 == string::npos )
break;
if( pos1 < pos2 ){
s.replace... | a.cc: In function 'int main()':
a.cc:19:25: error: 'i' was not declared in this scope
19 | i = pos1 + 5;
| ^
a.cc:22:25: error: 'i' was not declared in this scope
22 | i = pos2 + 5;
| ^
|
s333768050 | p00050 | C++ | #include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
char ary[1010];
int main(){
gets(ary);
int n=strlen(ary);
stack<int> pe,ap;
for(int i=0;i<n-4;i++){
if(ary[i]=='a'&&ary[i+1]=='p'&&ary[i+2]=='p'&&ary[i+3]=='l'&&ary[i+4]=='e') ap.push(i);
else if(ary[i]=='p'&&ary[i+1]=='e'&&ary[i+2]=='a... | a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(ary);
| ^~~~
| getw
|
s671541151 | p00050 | C++ | #include<stdio.h>
#include<string.h>
int main()
{
int c;
char str[1024];
gets(str);
for(c=0;c<strlen(str);c++){
if(strncmp(&str[c],"apple",5)==0){
str[c]='p';
str[c+1]='e';
str[c+2]='a';
str[c+3]='c';
str[c+4]='h';
}else if(strncmp(&str[c],"peach",5)==0){
str[c]='a';
str[c+1]='p';
str[c+... | a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(str);
| ^~~~
| getw
|
s563381360 | p00050 | C++ | #include <stdio.h>
int main(){
char c[1000],now=0;
for(int i=0;i<1000;i++)c[i]='\0';
while(scanf("%c",&c[now])!=EOF)now++;
for(int i=0;c[i]!='\0';i++){
if(c[i]=='p'&&c[i+1]=='e'&&c[i+2]=='a'&&c[i+3]=='c'&&c[i+4]=='h'){
c[i]=a;
c[i+1]=p;
c[i+2]=p;
c[i+3]=l;
c[i+4]=e;
}
if(c[i]=='a'&&c[i+1]=='p'&&c[i+2]=='p'&&c[i+3]=='l... | a.cc: In function 'int main()':
a.cc:9:6: error: 'a' was not declared in this scope
9 | c[i]=a;
| ^
a.cc:10:8: error: 'p' was not declared in this scope
10 | c[i+1]=p;
| ^
a.cc:12:8: error: 'l' was not declared in this scope
12 | c[i+3]=l;
| ^
a.cc:13:8: error: 'e' was not... |
s117285754 | p00050 | C++ | #include <stdio.h>
int main(){
char c[1000];
int now=0;
for(int i=0;i<1000;i++)c[i]='\0';
while(scanf("%c",&c[now])!=EOF)now++;
for(int i=0;c[i]!='\0';i++){
if(c[i]=='p'&&c[i+1]=='e'&&c[i+2]=='a'&&c[i+3]=='c'&&c[i+4]=='h'){
c[i]=a;
c[i+1]=p;
c[i+2]=p;
c[i+3]=l;
c[i+4]=e;
}
if(c[i]=='a'&&c[i+1]=='p'&&c[i+2]=='p'&&c[i+3... | a.cc: In function 'int main()':
a.cc:10:6: error: 'a' was not declared in this scope
10 | c[i]=a;
| ^
a.cc:11:8: error: 'p' was not declared in this scope
11 | c[i+1]=p;
| ^
a.cc:13:8: error: 'l' was not declared in this scope
13 | c[i+3]=l;
| ^
a.cc:14:8: error: 'e' was no... |
s193301718 | p00050 | C++ | #include<stdio.h>
#include <string.h>
int main(void){
char str[1000];
int i,l;
fgets(str,1000,stdin);
l=strlen(str);
for(i=0;i<l;i++){
if(str[i]=='p' && str[i+1]=='e'&&str[i+2]=='a'&&str[i+3]=='c'&&str[i+4]=='h'){
str[i]='a';
str[i+1]='p';
str[i+2]='p';
str[i+3]='l';
str[... | a.cc: In function 'int main()':
a.cc:23:2: error: expected primary-expression before '?' token
23 | ??????i=i+4;
| ^
a.cc:23:3: error: expected primary-expression before '?' token
23 | ??????i=i+4;
| ^
a.cc:23:4: error: expected primary-expression before '?' token
23 | ??????i=i+4;
| ... |
s354219220 | p00050 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
int n = 0;
string a[1000];
while(cin >> a[n]){
if(a[n] == "apple"){
a[n] = "peach";
}else if (a[n] == "peach"){
a[n] = "apple";
}else if(a[n] == "apple."){
a[n] = "peach.";
}else if (a[n] == "peach."){
a... | a.cc: In function 'int main()':
a.cc:23:13: error: 'i' was not declared in this scope
23 | cout << a[i-1] <<endl;
| ^
|
s527036263 | p00050 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
int n = 0;
string a[1000];
while(cin >> a[n]){
if(a[n] == "apple"){
a[n] = "peach";
}else if (a[n] == "peach"){
a[n] = "apple";
}else if(a[n] == "apple."){
a[n] = "peach.";
}else if (a[n] == "peach."){
a... | a.cc: In function 'int main()':
a.cc:23:13: error: 'i' was not declared in this scope
23 | cout << a[i-1] <<endl;
| ^
|
s719913688 | p00050 | C++ | #include <cstdio>
#include <cstring>
using namespace std;
int main(void){
char buf[1024],*p;
gets(buf);
while(p=strstr(buf,"apple")){
strncpy(p,"*****", 5);
}
while(p=strstr(buf,"peach")){
strncpy(p,"apple",5);
}
while(p=strstr(buf,"*****")){
strncpy(p,"peach",5);
}
puts(buf);
retur... | a.cc: In function 'int main()':
a.cc:9:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(buf);
| ^~~~
| getw
|
s473377441 | p00050 | C++ | #include <cstdio>
#include <cstring>
using namespace std;
int main(void){
char buf[1024],*p;
fgets(buf, 1024, stdin);
while(p=strstr(buf,"apple")){
strncpy(p,"*****", 5);
}
while(p=strstr(buf,"peach")){
strncpy(p,"apple",5);
}
while(p=strstr(buf,"*****")){
strncpy(p,"peach",5);
}
strr... | a.cc: In function 'int main()':
a.cc:19:10: error: lvalue required as left operand of assignment
19 | strrchr(buf,10)=0;
| ~~~~~~~^~~~~~~~
|
s168169809 | p00050 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
int n = 0;
vector<string> a(1000);
while(cin >> a){
if(a[n] == "apple"){
a[n] = "peach";
}else if (a[n] == "peach"){
a[n] = "apple";
}else if(a[n] == "apple."){
a[n] = "peach.";
}else if (a[n]... | a.cc: In function 'int main()':
a.cc:9:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
9 | while(cin >> a){
| ~~~ ^~ ~
| | |
| | std::vector<std::__cxx1... |
s103092603 | p00050 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
int n = 0;
vector<string> a(1000);
while(cin >> a){
if(a[n] == "apple"){
a[n] = "peach";
}else if (a[n] == "peach"){
a[n] = "apple";
}else if(a[n] == "apple."){
a[n] = "peach.";
}else if (a[n]... | a.cc: In function 'int main()':
a.cc:9:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
9 | while(cin >> a){
| ~~~ ^~ ~
| | |
| | std::vector<std::__cxx1... |
s539936808 | p00050 | C++ | #include<stdio.h>
#include<string.h>
int main(){
char ss[2000],out[2000],temp[2000];
int i,j,k;
while(NULL!=gets(ss)){
j=0;
for(i=0;i<1800;i++){
if(ss[i]=='a' && ss[i+1]=='p' && ss[i+2]=='p' && ss[i+3]=='l' && ss[i+4]=='e'){
out[j]='p';
out[j+1]='e';
out[j+2]='a';
out[j+3]='c';
out[j+4]... | a.cc: In function 'int main()':
a.cc:8:21: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | while(NULL!=gets(ss)){
| ^~~~
| getw
|
s434331559 | p00050 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#define f first
#define s second
#define mp make_pair
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) ... | a.cc: In function 'int main()':
a.cc:27:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
27 | while(gets(buff)){
| ^~~~
| getw
|
s665016681 | p00050 | C++ | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <iomanip>
using namespace std;
int main(){
string s,a="apple",p="peach";
vector<string> v;
while(cin>>s){
if(s.size()>=5){
if(!(a.compare(s.substr(0,5))))s="peach";
... | a.cc: In function 'int main()':
a.cc:19:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
19 | if(s[s.size()-1]=="."{
a.cc:19:26: error: expected ')' before '{' token
19 | if(s[s.size()-1]=="."{
| ~ ^
| )
a.cc:27:3:... |
s164471425 | p00050 | C++ | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <iomanip>
using namespace std;
int main(){
string s,a="apple",p="peach";
vector<string> v;
while(cin>>s){
if(s.size()>=5){
if(!(a.compare(s.substr(0,5))))s="peach";
... | a.cc: In function 'int main()':
a.cc:26:13: error: expected ';' before '}' token
26 | return 0}
| ^
| ;
a.cc: At global scope:
a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s429228647 | p00050 | C++ | import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
ArrayList<String> al = new ArrayList<String>();
while(sc.hasNext()) {
String s = sc.next();
if(s.contains("apple")) {
al.add(s.replace("apple", "peach"));
} else if(s.contains("peac... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s853407944 | p00050 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
vector<string> split(string&);
void StringHandle(string&);
bool space(char);
bool not_space(char);
int main(){
string str;
vector<string> Str;
getline(cin, str);
Str = split(str);
for(string::size_type i=0; i<Str.size(); ++i){
... | a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > split(std::string&)':
a.cc:40:9: error: 'find_if' was not declared in this scope
40 | i = find_if(j, str.end(), not_space);
| ^~~~~~~
|
s061414726 | p00050 | C++ | #include <stdio.h>
#include <string.h>
int main(void){
char s[1001];
char* p;
char* a;
gets(s);
p = strstr(s, "peach");
a = strstr(s, "apple");
while(1){
if(p == NULL && a == NULL) break;
if(a == NULL || p < a && p != NULL){
p[0] = 'a';
p[1] = 'p';
p[2] = 'p';
p[3] = 'l';
p[4] = 'e';
p = ... | a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(s);
| ^~~~
| getw
|
s727092058 | p00050 | C++ | #include<cstdio>
int main()
{
char map[2][6]={"apple","peach"};
char c[1005]={0};
gets(c);
for(int i=0;i<1000;i++)
{
if(c[i]=='\0')break;
int a=0,p=0;
for(int j=0;j<5;j++)
{
if(map[0][j]==c[i+j])a++;
if(map[1][j]==c[j+i])p++;
}
if(a==5)
{
printf("peach");
i+=4;
}
if(p==5)
{
prin... | a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(c);
| ^~~~
| getw
|
s856165437 | p00050 | C++ | #include<cstdio>
int main()
{
char map[2][6]={"apple","peach"};
char c[1005]={0};
gets(c);
for(int i=0;i<1000;i++)
{
if(c[i]=='\0')break;
int a=0,p=0;
for(int j=0;j<5;j++)
{
if(map[0][j]==c[i+j])a++;
if(map[1][j]==c[j+i])p++;
}
if(a==5)
{
printf("peach");
i+=4;
}
if(p==5)
{
prin... | a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(c);
| ^~~~
| getw
|
s719951640 | p00050 | C++ | #include<cstdio>
int main()
{
char map[2][6]={"apple","peach"};
char c[10000]={0};
gets(c);
for(int i=0;i<1000;i++)
{
if(c[i]=='\0')break;
int a=0,p=0;
for(int j=0;j<5;j++)
{
if(map[0][j]==c[i+j])a++;
if(map[1][j]==c[j+i])p++;
}
if(a==5)
{
printf("peach");
i+=4;
}
if(p==5)
{
pri... | a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(c);
| ^~~~
| getw
|
s024278351 | p00050 | C++ | import java.io.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class aoj0050 {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s,ans;
s = br.readLine();
Matcher m = Pattern.compile("a... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.regex.Pattern;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts... |
s419125365 | p00050 | C++ | using System;
namespace _0050
{
class Program
{
static void Main(string[] args)
{
var modifyTexts = Console.ReadLine().Replace("apple", "apple_").Replace("peach", "apple").Replace("apple_", "peach");
Console.WriteLine(modifyTexts);
}
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:7:26: error: 'string' has not been declared
7 | static void Main(string[] args)
| ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
7 | static... |
s196113882 | p00050 | C++ | using System;
namespace _0050
{
class Program
{
static void Main(string[] args)
{
var modifyTexts = Console.ReadLine().Replace("apple", "apple_").Replace("peach", "apple").Replace("apple_", "peach");
Console.WriteLine(modifyTexts);
}
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:7:26: error: 'string' has not been declared
7 | static void Main(string[] args)
| ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
7 | static... |
s710664092 | p00050 | C++ | using System;
namespace _0050
{
class Program
{
static void Main(string[] args)
{
string modifyTexts = Console.ReadLine().Replace("apple", "apple_").Replace("peach", "apple").Replace("apple_", "peach");
Console.WriteLine(modifyTexts);
}
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:7:26: error: 'string' has not been declared
7 | static void Main(string[] args)
| ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
7 | static... |
s568758337 | p00051 | Java | import java.io.*;
import java.util.Arrays;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
int maxValue;
int minValue;
int dif;
int[] num=new int[8];
int n=Integer.parseInt(br.readLine());
for(int p=0;p<n;p++... | Main.java:27: error: ';' expected
System.out.println(dif)
^
1 error
|
s860879222 | p00051 | Java | import java.io.*;
import java.util.Arrays;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
int maxValue;
int minValue;
int dif;
int[] num=new int[8];
int n=Integer.parseInt(br.readLine());
for(int p=0;p<n;p++... | Main.java:23: error: method pow in class Math cannot be applied to given types;
maxValue+=num[i]*Math.pow(i);
^
required: double,double
found: int
reason: actual and formal argument lists differ in length
Main.java:24: error: method pow in class Math cannot be applied to given types;
minVa... |
s943698493 | p00051 | Java | import java.io.*;
class Main
{
public static void main(String args[])throws IOException
{
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
int n=Integer.parseInt(input.readLine());
for(int i=0;i<n;i++)
{
String str=input.readLine();
String str_ary[]=new String[8];
int a[]... | Main.java:68: error: 'else' without 'if'
else if(b[l]!=0)strb+=Integer.toString(b[l]);
^
1 error
|
s243033401 | p00051 | Java | import java.util.Arrays;
import java.util.Scanner;
public class Test {
public static void main(String[] args){
Scanner scan = null;
try{
scan = new Scanner(System.in);
int n = scan.nextInt();
for(int i = 0 ; i < n;i++){
char[] data = scan.next().toCharArray();
int[] num = new int[data.length];
... | Main.java:5: error: class Test is public, should be declared in a file named Test.java
public class Test {
^
1 error
|
s249937424 | p00051 | C | #include <stdio.h>
#include <algorithm>
using namespace std;
int main(void)
{
char num[9];
int array[8];
int n;
int i;
int j;
int array2[8];
int max = 0;
int min = 0;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%s", num);
for (j = 0; j < 8; j++){
array[j] = num[j] - '0';
}
sort(array, arr... | main.c:2:10: fatal error: algorithm: No such file or directory
2 | #include <algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s902975716 | p00051 | C | #include <stdio.h>
#include <algorithm>
using namespace std;
int main(void)
{
char num[9];
int array[8];
int n;
int i;
int j;
int array2[8];
int num_max;
int num_min;
scanf("%d", &n);
for (i = 0; i < n; i++){
num_max = 0;
num_min = 0;
scanf("%s", num);
for (j = 0; j < 8; j++){
array[j] = num[j... | main.c:2:10: fatal error: algorithm: No such file or directory
2 | #include <algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s736432070 | p00051 | C | #include<stdio.h>
int main(void)
{
int i.j,n,max,min,t,ii,k;
int num[8];
int tem[8];
scanf("%d",&n);
for(k=0;k<n;k++){
max=0;
min=0;
ii=1;
for(i=0;i<8;i++){
scanf("%d",&num[i]);
tem[i]=num[i];
}
for(i=0;i<8;i++){
for(j=i;j<7;j++){
if(tem[j]>tem[j+1]){
t=tem[j];
tem[j]=tem[j+1];
tem[j+1]=t;
if(num[j]<num[j+1]){
t=n... | main.c: In function 'main':
main.c:5:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
5 | int i.j,n,max,min,t,ii,k;
| ^
main.c:5:6: error: expected expression before '.' token
main.c:5:9: error: 'n' undeclared (first use in this function)
5 | int i.j,n,max,min,t,ii,k;
... |
s915275740 | p00051 | C | #include<stdio.h>
int main(void)
{
int i,j,n,max,min,t,ii,k;
int num[8];
int tem[8];
scanf("%d",&n);
for(k=0;k<n;k++){
max=0;
min=0;
ii=1;
for(i=0;i<8;i++){
scanf("%d",&num[i]);
tem[i]=num[i];
}
for(i=0;i<8;i++){
for(j=i;j<7;j++){
if(tem[j]>tem[j+1]){
t=tem[j];
tem[j]=tem[j+1];
tem[j+1]=t;
if(num[j]<num[j+1]){
t=n... | main.c: In function 'main':
main.c:44:1: error: expected declaration or statement at end of input
44 | }
| ^
main.c:44:1: error: expected declaration or statement at end of input
|
s574477920 | p00051 | C | include <stdio.h>
#include <stdlib.h>
#define N 8
int main(void){
int i, j, k, n, max, min;
char tmp, num[N+1];
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%s", num);
for(j = N-1; j > 0; j--){
for(k = 0; k < j; k++){
if(num[k] > num[k+1]){
tmp = num[k];
num[k] = num[k+1];
num[k+1]... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
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 (void) __THROW __wur;
| ^~~~~~
/usr/inc... |
s217792986 | p00051 | C | #include <stdio.h>
using namespace std;
#include <iostream>
int main(void){
int n, i, j, k;
int num[50], high[50], low[50];
char str[50][10], tmp;
scanf("%d", &n);
for (i=0;i<n;i++) {
scanf("%s",str[i]);
}
for (k=0;k<n;k++) {
for (i=0;i<7;i++) {
for ( j=7;j>i;j--) {
if (str[k][j... | main.c:2:1: error: unknown type name 'using'
2 | using namespace std;
| ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
2 | using namespace std;
| ^~~
main.c:3:10: fatal error: iostream: No such file or directory
3 | #include <iostream>
... |
s611391048 | p00051 | C | #include<stdio.h>
void swap(int *x,int *y){
int k;
k=*x;
*x=*y;
*y=k;
}
int func(int a){
int i,j,x[8],max,min;
x[0]=a%10;
x[1]=a/10%10;
x[2]=a/100%10;
x[3]=a/1000%10;
x[4]=a/10000%10;
x[5]=a/100000%10;
x[6]=a/1000000%10;
x[7]=a/10000000%10;
for(j=0;j<8;j++)
for(i=0;i<7;i++)
if(x[i]<x[i+1])swap(&x[i],&x[i+1])
min=100000... | main.c: In function 'func':
main.c:20:35: error: expected ';' before 'min'
20 | if(x[i]<x[i+1])swap(&x[i],&x[i+1])
| ^
| ;
21 | min=10000000*x[7]+1000000*x[6]+100000*x[5]+10000*x[4]+1000*x[3]+100*x[2]+10*x[1]+x[0];
| ~~~ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.