結果
| 問題 |
No.18 うーさー暗号
|
| コンテスト | |
| ユーザー |
Seto
|
| 提出日時 | 2017-01-15 05:27:47 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 217 bytes |
| コンパイル時間 | 216 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-21 13:05:45 |
| 合計ジャッジ時間 | 902 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 13 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:16: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
6 | for(i=0; i < strlen(s); i++){
| ^~~~~~
main.c:2:1: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
1 | #include<stdio.h>
+++ |+#include <string.h>
2 | int main(){
main.c:6:16: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch]
6 | for(i=0; i < strlen(s); i++){
| ^~~~~~
main.c:6:16: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
main.c:5:3: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | fgets(s, sizeof(s), stdin);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(){
char s[1024];
int i;
fgets(s, sizeof(s), stdin);
for(i=0; i < strlen(s); i++){
printf("%c", 'A' + ((s[i] - 'A' + 26 - 1) - (i % 26)) % 26);
}
putchar('\n');
return 0;
}
Seto