2 solutions

  • 0
    @ 2026-1-6 21:20:01

    #include <bits/stdc++.h> using namespace std;

    int main() { int a, b, c, d, e, f, g, h, i, j, k, l, m, n; cin >> a; b = a / 100; c = (a - b * 100) / 50; d = (a - b * 100 - c * 50) / 20; e = (a - b * 100 - c * 50 - d * 20) / 10; f = (a - b * 100 - c * 50 - d * 20 - e * 10) / 5; g = (a - b * 100 - c * 50 - d * 20 - e * 10 - f * 5) / 1; cout << b << '\n' << c << '\n' << d << '\n' << e << '\n' << f << '\n' << g; return 0; }

    • 0
      @ 2025-10-29 15:38:53
      #include<iostream>
      #include<iomanip>
      using namespace std;
      int main(){
          int a, b;
          cin>>a;
          int n_100, n_50, n_20, n_10, n_5, n_1;
          n_100 = a/100;
          b = a%100;
          n_50 = b/50;
          b = b%50;
          n_20 = b/20;
          b = b%20;
          n_10 = b/10;
          b = b%10;
          n_5 = b/5;
          b = b%5;
          n_1 = a%100%50%20%10%5;
          cout<<n_100<<endl<<n_50<<endl<<n_20<<endl<<n_10<<endl<<n_5<<endl<<n_1<<endl;
          return 0;
      }
      
      • 1

      Information

      ID
      371
      Time
      60ms
      Memory
      10MiB
      Difficulty
      5
      Tags
      # Submissions
      531
      Accepted
      194
      Uploaded By