結果
| 問題 |
No.1499 羊が、何匹だっけ
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-18 11:18:17 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 358 bytes |
| コンパイル時間 | 429 ms |
| コンパイル使用メモリ | 26,112 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-18 11:18:18 |
| 合計ジャッジ時間 | 1,179 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
コンパイルメッセージ
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",&t);
| ^~~~~~~~~~~~~~
main.c:11:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%s" ,sleep[j]);
| ^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
void main(void) {
int t;
scanf("%d",&t);
int sheepList[t];
char sleep[4][1000] = {"a","a","a","a"};
for(int i = 0 ; i < t ; i++ ){
for(int j = 0 ; j < 4;j++){
scanf("%s" ,sleep[j]);
}
sheepList[i] = atoi(sleep[2])+1;
}
for(int i = 0 ; i < t ; i++ ){
printf("Hitsuji ga %d hiki\n",sheepList[i]);
}
}
Maeda