Advertisement
Josif_tepe

Untitled

Dec 23rd, 2023
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9.     int a;
  10.     int b;
  11.     cin>>a>>b;
  12.     if(a==b)
  13.         cout<<"0"<<endl;
  14.     else{
  15.         int x=b-a;
  16.         int petki;
  17.         int kusur;
  18.         int dvojki;
  19.         int edinici;
  20.         int vkupno;
  21.     petki=x/5;
  22.     kusur=x%5;
  23.     dvojki=kusur/2;
  24.     edinici=kusur%2;
  25.     vkupno=petki+dvojki+edinici;
  26.     cout<<vkupno<<endl;
  27.     }
  28.  
  29.  
  30.    return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement