結果

問題 No.1217 せしすせそ
ユーザー akobaakoba
提出日時 2021-01-25 17:08:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 323 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 63,848 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-04 09:55:39
合計ジャッジ時間 4,022 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘void solve(const char*)’ 内:
main.cpp:8:5: 警告: iteration 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]
    8 |     for (int n = 0; n != 'a' - 'z'; n++) {
      |     ^~~
main.cpp:8:23: 備考: within this loop
    8 |     for (int n = 0; n != 'a' - 'z'; n++) {
      |                     ~~^~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <string>

using namespace std;

void solve(const char *s)
{
    for (int n = 0; n != 'a' - 'z'; n++) {
        char c = 'a' + n;
        if (s[n] != c) {
            cout << c << "to" << s[n] << endl;
        }
    }
}

int main()
{
    string text;
    cin >> text;
    solve(text.c_str());
}
0