就是纯纯模拟竖式除法的一道题目
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin>>n;
int res = 1;
int cnt = 0;
while(res<n){
res = res * 10+1;
cnt++;
}
while(1){
if(res%n == 0){
cout<<res/n;
cnt++;
break;
}
int i = res/n;
cout<<i;
int shengyu = res - i * n;
cnt++;
shengyu = shengyu * 10 + 1;
res = shengyu;
}
cout<<" "<<cnt;
}