Advertisement
Josif_tepe

Untitled

Nov 12th, 2022
856
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.    
  6.     int N;
  7.     scanf("%d", &N);
  8.    
  9.     int desetki = N / 10;
  10.     N = N - (desetki * 10);
  11.    
  12.     int petki = N / 5;
  13.     N = N - (petki * 5);
  14.    
  15.     int dvojki = N / 2;
  16.     N = N - (dvojki * 2);
  17.    
  18.     int edinici = N / 1;
  19.     N = N - (edinici * 1);
  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