4

これが私が取り組んでいるコードです。「b」の入力をテストし、他に何か入力された場合は「Y」を出力する必要があります。

なぜ偽の値に「Y」を使用することにしたのか、誰も聞かないでください..

> , <
+++++ +++++
[
    > ----- ----
    < -
]
> ----- --- <


[
    >
    +++++ +++++
    [
            > +++++ +++
            < -
    ]
    > +++++ ++++ <
    . <
]

同等のものを希望します

char c;
c = getchar();
if (c == 'b')
    putchar('Y');

プログラムに何を入力しても、出力が得られません(ファイルに送信して16進ダンプし、画面には何も表示されません)

4

2 に答える 2

8

ほぼ 2 年後、これはもう必要ないかもしれませんが、「if - else」ステートメントの私のバージョンは次のとおりです。

+++++ +++++
+++++ +++++
+++++ +++++
+++           (this is the value you want to check, in this case it's the "!")

> , <         (then you take input an char to compare)
[ - > - < ]   (after that you have to check if their ascii values are the same)
>>            (and initialize the answer on "true")

+++++ +++++
+++++ +++++
+++++ +++++
+++++

< [ - > ] > . (if "false", this loop will be executed and the answer won't be printed)

今日誰かに役立つことを願っています。:D

于 2015-06-27T10:28:29.093 に答える