結果
問題 | No.858 わり算 |
ユーザー |
|
提出日時 | 2020-06-03 12:06:18 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 214 bytes |
コンパイル時間 | 205 ms |
コンパイル使用メモリ | 25,600 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-01-07 14:54:15 |
合計ジャッジ時間 | 745 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:3:27: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long long int *’ [-Wformat=] 3 | long long a,b;scanf("%d %d",&a,&b); | ~^ ~~ | | | | int * long long int * | %lld main.c:3:30: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long long int *’ [-Wformat=] 3 | long long a,b;scanf("%d %d",&a,&b); | ~^ ~~ | | | | int * long long int * | %lld main.c:4:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=] 4 | printf("%d.",a/b); | ~^ ~~~ | | | | int long long int | %lld main.c:8:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=] 8 | printf("%d",a/b); | ~^ ~~~ | | | | int long long int | %lld main.c:3:19: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 3 | long long a,b;scanf("%d %d",&a,&b); | ^~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main(){ long long a,b;scanf("%d %d",&a,&b); printf("%d.",a/b); a%=b; for(int i=0;i<50;++i){ a*=10; printf("%d",a/b); a-=a/b*b; } printf("\n"); }