Advertisement
Josif_tepe

Untitled

Nov 12th, 2022
882
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main() {
  5.     int N;
  6.     scanf("%d", &N);
  7.    
  8.     int desetki = N / 10;
  9.     N = N - (desetki * 10);
  10.    
  11.     int petki = N / 5;
  12.     N = N - (petki * 5);
  13.    
  14.     int dvojki = N / 2;
  15.     N = N - (dvojki * 2);
  16.    
  17.     int edinici = N / 1;
  18.     N = N - (edinici * 1);
  19.    
  20.    
  21.     printf("%d moneti od 10 denari\n", desetki);
  22.     printf("%d moneti od 5 denari\n", petki);
  23.     printf("%d moneti od 2 denari\n", dvojki);
  24.     printf("%d moneti od 1 denar\n", edinici);
  25.    
  26.     return 0;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement