結果
問題 | No.3000 enuemu暗号 |
ユーザー | startcpp |
提出日時 | 2016-08-14 13:53:44 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 519 bytes |
コンパイル時間 | 541 ms |
コンパイル使用メモリ | 55,264 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 16:44:43 |
合計ジャッジ時間 | 1,142 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,248 KB |
testcase_03 | WA | - |
コンパイルメッセージ
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; } } } p++; } cout << endl; return 0; }