3 solutions

  • 0
    @ 2023-5-21 22:58:07

    #include<bits/stdc++.h>

    using namespace std;

    int main() { long long n; cin >> n;

    cout << n / 100 << endl;
    n %= 100;
    
    cout << n / 50 << endl;
    n %= 50;
    
    cout << n / 20 << endl;
    n %= 20;
    
    cout << n / 10 << endl;
    n %= 10;
    
    cout << n / 5 << endl;
    n %= 5;
    
    cout << n / 1;
    	
    return 0;
    

    } 注意类型!!!!!我踩雷了

    Information

    ID
    33
    Time
    60ms
    Memory
    10MiB
    Difficulty
    7
    Tags
    # Submissions
    61
    Accepted
    12
    Uploaded By