标签:family 思路 cst 开始 end ace 统一 cout stream
本题运用:
#include<stdio.h> #include<algorithm> #include<iostream> #include<vector> #include<stack> #include<set> #include<queue> #include<cstring> #define ll long long using namespace std; ll power(ll a,ll b,ll q) { ll res=1; while(b) { if(b%2) res=res*a%q; b=b/2; a=a*a%q; } return res%q; } int main() { ll a,b,n,ans; while(cin>>a>>b>>n) { ll q=b*1000; ans = (a%q)*power(10,n+2,q); ans = ans/b; cout<<ans%1000<<endl; } return 0; }
标签:family 思路 cst 开始 end ace 统一 cout stream
原文地址:https://www.cnblogs.com/shoulinniao/p/10415897.html