結果

問題 No.1499 羊が、何匹だっけ
ユーザー suppy193suppy193
提出日時 2021-05-09 18:23:44
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 472 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 21,464 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 03:31:00
合計ジャッジ時間 976 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 0 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
      |                 ^~~~~~~~~~~~~~

ソースコード

diff #

#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;
}
0