結果

問題 No.8000 enuemu暗号
ユーザー TLwiegehtt
提出日時 2015-07-21 21:03:00
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 237 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 20,608 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-08 11:35:31
合計ジャッジ時間 832 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:17: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[110]’ [-Wformat=]
    9 |         scanf("%s", &s);
      |                ~^   ~~
      |                 |   |
      |                 |   char (*)[110]
      |                 char *
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%s", &s);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void){
	int i;
	char code[] = "cqlmdrstfxyzbanopuvweghijk";
	char s[110];
	
	
	scanf("%s", &s);
	
	for(i=0;s[i] != '\0'; i++){
		int tmp = s[i] - 'a';
		s[i] = code[tmp];
	}
	
	printf("%s\n", s);
	return 0;
}
0