ログイン
新規登録
AtsuoCoder Petrozavodsk Contest 001
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 115147c7-7843-403c-99b4-5649d710fb8e
コード
#include <bits/stdc++.h> using namespace std; int main() { int s; cin >> s; string str = s; str.at('A') = 'P'; // char型の'M' str.at('P') = 'C'; str.at('C') = 'A'; std::string first = s; std::string second = "MAN"; std::string combined = first + " " + second; std::cout << combined << std::endl; // 出力:Hello World }
結果
問題
点数
言語
結果
実行時間
メモリ
D - PACMAN
0
C++
WJ
0 ms
0 KiB
コンパイルエラー
Main.cpp: In function 'int main()': Main.cpp:7:16: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 7 | string str = s; | ^ Main.cpp:11:26: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 11 | std::string first = s; | ^