40pts求调
查看原帖
40pts求调
1326082
封禁用户楼主2025/1/17 21:30

#3 #4 #5 #6 TLE

大佬们求调

#include<iostream>
using namespace std;
int main()
{
 int a,b,n,quotient[100000]={0};
 scanf("%d%d%d",&a,&b,&n);
 int count=0,temp=a;
 while(1)
 {
  if(temp/b==0) break;
  temp%=b;count++;
 }
 int i=0,mod=a;
 while(i<(n+3+count))
 {
  if(i<count){i++;mod%=b;}
   else
 {
  if(i>=(n+count)) printf("%d",mod/b);
  i++;
  mod=mod%b*10;
 }
 }
 return 0;
}
2025/1/17 21:30
加载中...