ログイン
新規登録
AtsuoCoder Petrozavodsk Contest 001
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 2cbbdcef-e23e-45f9-a005-bd09816338d3
コード
#include <iostream> #include <regex> using namespace std; int main() { string s; string str1 = regex_replace(s, regex("A"), "P"); cout << str1 << endl; string str1 = regex_replace(s, regex("C"), "A"); cout << str1 << endl; //zzz-bbz string str1 = regex_replace(s, regex("P"), "C"); cout << str1 << endl; //zzz-bbz str.appendlast("MAN");
結果
問題
点数
言語
結果
実行時間
メモリ
D - PACMAN
0
C++
WJ
0 ms
0 KiB
コンパイルエラー
Main.cpp: In function 'int main()': Main.cpp:9:16: error: redeclaration of 'std::string str1' 9 | string str1 = regex_replace(s, regex("C"), "A"); | ^~~~ Main.cpp:7:16: note: 'std::string str1' previously declared here 7 | string str1 = regex_replace(s, regex("A"), "P"); | ^~~~ Main.cpp:11:12: error: redeclaration of 'std::string str1' 11 | string str1 = regex_replace(s, regex("P"), "C"); | ^~~~ Main.cpp:7:16: note: 'std::string str1' previously declared here 7 | string str1 = regex_replace(s, regex("A"), "P"); | ^~~~ Main.cpp:13:10: error: 'str' was not declared in this scope; did you mean 'str1'? 13 | str.appendlast("MAN"); | ^~~ | str1 Main.cpp:13:32: error: expected '}' at end of input 13 | str.appendlast("MAN"); | ^ Main.cpp:5:12: note: to match this '{' 5 | int main() { | ^