ログイン
新規登録
AtsuoCoder Petrozavodsk Contest 001
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 6b939e15-4df5-4653-82f3-e27e12f2e060
コード
#include <bits/stdc++.h> using namespace std; int main(void){ string S; for (int i = 0; i < S.size(); i++) { if(S.at(i) =="A") S.at(i) = "P"; if(S.at(i) =="C") S.at(i) = "A"; if(S.at(i) =="P") S.at(i) = "C"; } cout << S; }
結果
問題
点数
言語
結果
実行時間
メモリ
D - PACMAN
0
C++
WJ
0 ms
0 KiB
コンパイルエラー
Main.cpp: In function 'int main()': Main.cpp:6:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 6 | if(S.at(i) =="A") S.at(i) = "P"; | ~~~~~~~~^~~~~ Main.cpp:6:37: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 6 | if(S.at(i) =="A") S.at(i) = "P"; | ^~~ | | | const char* Main.cpp:7:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | if(S.at(i) =="C") S.at(i) = "A"; | ~~~~~~~~^~~~~ Main.cpp:7:37: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 7 | if(S.at(i) =="C") S.at(i) = "A"; | ^~~ | | | const char* Main.cpp:8:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if(S.at(i) =="P") S.at(i) = "C"; | ~~~~~~~~^~~~~ Main.cpp:8:37: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 8 | if(S.at(i) =="P") S.at(i) = "C"; | ^~~ | | | const char*