結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー testestesttestestest
提出日時 2015-09-09 19:58:08
言語 C90
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 428 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 24,112 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-21 13:02:07
合計ジャッジ時間 1,746 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 0 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 AC 0 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 0 ms
4,380 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 0 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
4,380 KB
testcase_24 WA -
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 0 ms
4,376 KB
testcase_27 WA -
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
 scanf("%lld",&n);
 ^~~~~
main.c:4:1: warning: incompatible implicit declaration of built-in function ‘scanf’
main.c:4:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:1:1:
+#include <stdio.h>
 int main(){
main.c:4:1:
 scanf("%lld",&n);
 ^~~~~
main.c:7:9: warning: implicit declaration of function ‘getchar’ [-Wimplicit-function-declaration]
 while(x=getchar()-10){
         ^~~~~~~
main.c:7:9: note: ‘getchar’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
main.c:26:1: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
 printf("%lld.%010lld",si,sf);
 ^~~~~~
main.c:26:1: warning: incompatible implicit declaration of built-in function ‘printf’
main.c:26:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #

int main(){
long long int si=0,sf=0,m,f,t,i,n;
char x;
scanf("%lld",&n);
for(n++;n--;){
m=f=t=i=0;
while(x=getchar()-10){
i+=f;
switch(x){
case 35:m=1;break;
case 36:f=1;si=m?si-t:si+t;t=0;break;
default:t=t*10+x-38;
}
}
if(f){
for(;i<10;i++)t*=10;
sf=m?sf-t:sf+t;
}else{
si=m?si-t:si+t;
}
}
m=10000000000;
si+=sf/m;sf%=m;
if(si<0)if(sf>0){si++;sf=m-sf;}
if(si>0)if(sf<0){si--;sf=m+sf;}
printf("%lld.%010lld",si,sf);
return 0;
}
0