結果

問題 No.432 占い(Easy)
コンテスト
ユーザー kotatsugame
提出日時 2017-08-11 04:37:15
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
+ 539µs
コード長 153 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 46 ms
コンパイル使用メモリ 29,568 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-28 01:44:05
合計ジャッジ時間 1,651 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:14: warning: data definition has no type or storage class
    1 | char a[1010];n,j;p;
      |              ^
main.c:1:18: warning: data definition has no type or storage class
    1 | char a[1010];n,j;p;
      |                  ^
main.c: In function ‘main’:
main.c:5:23: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch]
    5 |                 for(n=strlen(a);--n;a[n]=0)for(j=0;j++<n;a[j-1]=48+(p>9?p/10+p%10:p))p=a[j-1]+a[j]-96;
      |                       ^~~~~~
main.c:1:1: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
  +++ |+#include <string.h>
    1 | char a[1010];n,j;p;
/usr/bin/ld: /tmp/ccAEUkZ2.o: in function `main':
main.c:(.text.startup+0x1e): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #
raw source code

char a[1010];n,j;p;
main(i){
	for(;gets(a);--i&&puts(a))
	{
		for(n=strlen(a);--n;a[n]=0)for(j=0;j++<n;a[j-1]=48+(p>9?p/10+p%10:p))p=a[j-1]+a[j]-96;
	}
}
0