标签:scanf out stream lse str 任务 输入 小数 break
#include <stdio.h> #include <iostream> #include <algorithm> using namespace std; long long a,b,n; int main(){ scanf("%I64d %I64d %I64d", &a, &b, &n); long long t = a % b; if(t == 0){ cout<<"000"; return 0; } int count = 0; int flag = 0; while(--n){ if(t == 0) break; t = t * 10; t = t % b; count++; if(t == a % b) n = n % count; } if(!t) cout<<"000"; else{ t = t * 10; cout<< t / b; t = t % b; t = t * 10; cout<< t / b; t = t % b; t = t * 10; cout<< t / b; } return 0; }
标签:scanf out stream lse str 任务 输入 小数 break
原文地址:https://www.cnblogs.com/woxiaosade/p/10352113.html