結果
問題 | No.400 鏡 |
ユーザー |
![]() |
提出日時 | 2016-07-28 15:46:28 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 391 bytes |
コンパイル時間 | 826 ms |
コンパイル使用メモリ | 56,216 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-06 18:10:12 |
合計ジャッジ時間 | 969 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 8 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%s", str);//< = > , <> = <> , >>< = ><< , <<<>< = ><>>> | ~~~~~^~~~~~~~~~~
ソースコード
#include <cstdio> #include <iostream> #include <cstring> using namespace std; char str[21]; int main(void) { scanf("%s", str);//< = > , <> = <> , >>< = ><< , <<<>< = ><>>> int len = strlen(str); for (int i = 0; i < len; i++) { if (str[i] == '>') str[i] = '<'; else if (str[i] == '<') str[i] = '>'; } for (int i = len-1; i >= 0; i--) cout << str[i]; cout << endl; return 0; }