結果
問題 | No.3000 enuemu暗号 |
ユーザー | startcpp |
提出日時 | 2016-08-14 13:53:01 |
言語 | C++11 (gcc 11.4.0) |
結果 |
OLE
|
実行時間 | - |
コード長 | 512 bytes |
コンパイル時間 | 475 ms |
コンパイル使用メモリ | 56,332 KB |
実行使用メモリ | 3,328 KB |
最終ジャッジ日時 | 2024-11-07 16:44:08 |
合計ジャッジ時間 | 12,971 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | OLE | - |
testcase_01 | OLE | - |
testcase_02 | OLE | - |
testcase_03 | OLE | - |
コンパイルメッセージ
main.cpp:6:18: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 6 | char *from[3] = {"pfnovu", "axqwuf", "mbgrihcdejkolsty"}; | ^~~~~~~~ main.cpp:6:28: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 6 | char *from[3] = {"pfnovu", "axqwuf", "mbgrihcdejkolsty"}; | ^~~~~~~~ main.cpp:6:38: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 6 | char *from[3] = {"pfnovu", "axqwuf", "mbgrihcdejkolsty"}; | ^~~~~~~~~~~~~~~~~~ main.cpp:7:16: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 7 | char *to[3] = {"orange", "cipher", "bqsuftlmdxynzvwj"}; | ^~~~~~~~ main.cpp:7:26: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 7 | char *to[3] = {"orange", "cipher", "bqsuftlmdxynzvwj"}; | ^~~~~~~~ main.cpp:7:36: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 7 | char *to[3] = {"orange", "cipher", "bqsuftlmdxynzvwj"}; | ^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> #include <iostream> using namespace std; char *from[3] = {"pfnovu", "axqwuf", "mbgrihcdejkolsty"}; char *to[3] = {"orange", "cipher", "bqsuftlmdxynzvwj"}; int main() { char s[31]; cin >> s; char *p = s; bool flag; while ('a' <= *p && *p <= 'z') { flag = false; for (int i = 0; i < 3; i++) { for (int j = 0; j < strlen(from[i]); j++) { if (*p == from[i][j] && !flag) { cout << to[i][j]; flag = true; } } } } cout << endl; return 0; }