1 solutions

  • 2
    @ 2025-7-8 10:35:54
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a,b,n;
        cin>>a>>b>>n;
        for(int i=1;i<=n;i++)
        {
            //求第n-1个余数
            a%=b;
            //余数增大10倍,用以抵消小数影响
            a*=10;    
        }
        //取余
        cout<<a/b;
        return 0;
    }
    

    Information

    ID
    912
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    128
    Accepted
    49
    Uploaded By