結果

問題 No.1335 1337
ユーザー suppy193
提出日時 2021-03-03 00:25:46
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 20,352 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-03 03:00:54
合計ジャッジ時間 893 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%s", a);
      |         ^~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%s", s);
      |         ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {

	char a[101], s[101];
	int i;
	scanf("%s", a);
	scanf("%s", s);
	for(i = 0;s[i] != 0;i++){
		if(s[i] >= '0' && s[i] <= '9'){
			printf("%c", a[s[i] - '0']);
		}
		else
			printf("%c", s[i]);
	}
	printf("\n");

	return 0;
}
0