結果

問題 No.1942 Leading zero
ユーザー Maeda
提出日時 2025-03-18 11:29:06
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 25,472 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-18 11:29:08
合計ジャッジ時間 1,477 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d",&n);
      |         ^~~~~~~~~~~~~~
main.c:10:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |                 scanf("%s",str);
      |                 ^~~~~~~~~~~~~~~

ソースコード

diff #

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

void main(void) {
	int n = 0;
	scanf("%d",&n);
	int numList[n];
	for(int i = 0 ; i < n ; i++){
		char str[10000] = "a";
		scanf("%s",str);
		numList[i] = atoi(str);
	}
	for(int i = 0 ; i < n ; i++){
		printf("%d\n",numList[i]);
	}
}
0