結果

問題 No.2827 Enter User Name to Play
ユーザー vjudge1
提出日時 2025-04-17 18:23:22
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 585 ms
コンパイル使用メモリ 25,344 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-17 18:23:23
合計ジャッジ時間 1,604 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |         scanf("%d",&a);
      |         ^~~~~~~~~~~~~~
main.c:7:18: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |                  scanf("%s",arr);
      |                  ^~~~~~~~~~~~~~~
main.c:11:18: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |                  scanf("%d",&arr2[i]);
      |                  ^~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main(){
	int a;
	scanf("%d",&a);
char arr[a];

		 scanf("%s",arr);
	
	int arr2[a];
		for(int i=0;i<a;i++){
		 scanf("%d",&arr2[i]);
	}
	char arr3[a];
	for(int i=0;i<a;i++){
		arr3[i]=arr[arr2[i]-1];
	}
	
	for(int i=0;i<a;i++){
		 printf("%c",arr3[i]);
	}
}
0