結果
| 問題 |
No.1499 羊が、何匹だっけ
|
| コンテスト | |
| ユーザー |
suppy193
|
| 提出日時 | 2021-05-09 18:23:44 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 472 bytes |
| コンパイル時間 | 613 ms |
| コンパイル使用メモリ | 21,248 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-18 23:44:26 |
| 合計ジャッジ時間 | 1,166 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d", &t);
| ^~~~~~~~~~~~~~~
main.c:13:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%s", s); // Hitsuji
| ^~~~~~~~~~~~~~
main.c:15:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf("%s", s); // ga
| ^~~~~~~~~~~~~~
main.c:17:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
17 | scanf("%s", s);
| ^~~~~~~~~~~~~~
main.c:28:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
28 | scanf("%s", s); // hiki
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int t;
int n;
char s[20];
int i, j;
scanf("%d", &t);
for(i = 0;i < t;i++){
scanf("%s", s); // Hitsuji
printf("%s ", s);
scanf("%s", s); // ga
printf("%s ", s);
scanf("%s", s);
// printf("%s\n", s);
n = 0;
j = 0;
while(s[j] != 0){
// printf("%c", s[j]);
n *= 10;
n += s[j] - '0';
j++;
}
printf("%d ", n + 1);
scanf("%s", s); // hiki
printf("%s\n", s);
}
return 0;
}
suppy193