ログイン
新規登録
AtsuoCoder Petrozavodsk Contest 001
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 5725ba8e-67b6-414c-9a4d-f90f1e3e0753
コード
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i=1; i>s.size; i++){ if (s.(i-1) == A){ s.(i-1) == P; } if (s.(i-1) == C){ s.(i-1) == A; } if (s.(i-1) == P){ s.(i-1) == C; } } cout << s"MAN" << endl: }
結果
問題
点数
言語
結果
実行時間
メモリ
D - PACMAN
0
C++
WJ
0 ms
0 KiB
コンパイルエラー
Main.cpp: In function 'int main()': Main.cpp:7:23: error: invalid use of member function 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 7 | for (int i=1; i>s.size; i++){ | ~~^~~~ | () Main.cpp:8:15: error: expected unqualified-id before '(' token 8 | if (s.(i-1) == A){ | ^ Main.cpp:8:24: error: 'A' was not declared in this scope 8 | if (s.(i-1) == A){ | ^ Main.cpp:9:15: error: expected unqualified-id before '(' token 9 | s.(i-1) == P; | ^ Main.cpp:9:24: error: 'P' was not declared in this scope 9 | s.(i-1) == P; | ^ Main.cpp:11:15: error: expected unqualified-id before '(' token 11 | if (s.(i-1) == C){ | ^ Main.cpp:11:24: error: 'C' was not declared in this scope 11 | if (s.(i-1) == C){ | ^ Main.cpp:12:15: error: expected unqualified-id before '(' token 12 | s.(i-1) == A; | ^ Main.cpp:12:24: error: 'A' was not declared in this scope 12 | s.(i-1) == A; | ^ Main.cpp:14:15: error: expected unqualified-id before '(' token 14 | if (s.(i-1) == P){ | ^ Main.cpp:14:24: error: 'P' was not declared in this scope 14 | if (s.(i-1) == P){ | ^ Main.cpp:15:15: error: expected unqualified-id before '(' token 15 | s.(i-1) == C; | ^ Main.cpp:15:24: error: 'C' was not declared in this scope 15 | s.(i-1) == C; | ^ Main.cpp:18:14: error: expected ';' before string constant 18 | cout << s"MAN" << endl: | ^~~~~ | ;