結果

問題 No.722 100×100=1000
ユーザー %20%20
提出日時 2018-04-08 06:00:34
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 29,568 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 19:16:56
合計ジャッジ時間 1,491 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |         scanf("%d%d",&A,&B);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){
main.c:3:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |         scanf("%d%d",&A,&B);
      |         ^~~~~
main.c:3:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:11: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    5 |         a=abs(A);
      |           ^~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
  +++ |+#include <stdlib.h>
    1 | main(){
main.c:20:17: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   20 |                 printf("%lld\n",(long long)A*B/10);
      |                 ^~~~~~
main.c:20:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:20:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:18: warning: implicit declaration of function 'llabs' [-Wimplicit-function-declaration]
   21 |         }else if(llabs((long long)A*B)<=99999999){
      |                  ^~~~~
main.c:21:18: note: include '<stdlib.h>' or provide a declaration of 'llabs'
main.c:21:18: warning: incompatible implicit declaration of built-in function 'llabs' [-Wbuiltin-declaration-mismatch]
main.c:21:18: note: include '<stdlib.h>' or provide a declaration of 'llabs'
main.c:22:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   22 |                 printf("%d\n",A*B);
    

ソースコード

diff #

main(){
	int A,B,a,b,n,m;
	scanf("%d%d",&A,&B);
	
	a=abs(A);
	n=0;
	while(a!=0 && a%10==0){
		++n;
		a/=10;
	}
	
	b=abs(B);
	m=0;
	while(b!=0 && b%10==0){
		++m;
		b/=10;
	}
	
	if(1<=a&&a<=9 && n>=2 && 1<=b&&b<=9 && m>=2){
		printf("%lld\n",(long long)A*B/10);
	}else if(llabs((long long)A*B)<=99999999){
		printf("%d\n",A*B);
	}else{
		printf("E\n");
	}
}
0