Advertisement
Josif_tepe

Untitled

Oct 8th, 2021
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int S;
  8.     int K;
  9.     cin >> S;
  10.     cin >> K;
  11.     int cifri[10];
  12.     for (int i = 0; i < 10; i++)
  13.     {
  14.         cifri[i] = 0;
  15.     }
  16.     for (int i = S; i <= K; i++)
  17.     {
  18.         int broj = i;
  19.         while (broj > 0)
  20.         {
  21.             int posledna_cifra = broj % 10;
  22.             broj /= 10;
  23.             cifri[posledna_cifra]++;
  24.         }
  25.     }
  26.     for (int i = 0; i < 10; i++)
  27.     {
  28.         cout << cifri[i] << " ";
  29.     }
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement