結果

問題 No.1335 1337
ユーザー sasa
提出日時 2025-03-18 13:18:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 29,312 KB
実行使用メモリ 14,904 KB
最終ジャッジ日時 2025-03-18 13:18:17
合計ジャッジ時間 7,563 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2 RE * 1
other TLE * 1 -- * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%s",str);
      |         ~~~~~^~~~~~~~~~
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%s",input);
      |         ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h> 
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

int main(void){
	char str[10];
	scanf("%s",str);
	
	char input[100];
	scanf("%s",input);
	
	int len = strlen(input);
	
	for(int i = 0;i < len;i ++){
		if(isdigit(input[i])){
			int tmp = atoi(&input[i]);
			printf("%c",str[tmp]);
		}else{
			printf("%c",input[i]);
		}
	}
}
0