Advertisement
Josif_tepe

Untitled

Feb 15th, 2022
828
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. #include <vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main()
  9. {
  10.     double cena, pari;
  11.     cin >> cena >> pari;
  12.     int kolku = 0;
  13.     for(double i = 0.0; i <= (pari - cena); i++) {
  14.         if((int) (i + cena) % 5 == 0) {
  15.             double procent = i / (i + cena);
  16.             procent *= 100.0;
  17.             if(procent > 10) break;
  18.             if(procent >= 5 and procent <= 10) {
  19.                 kolku++;
  20.             }
  21.         }
  22.     }
  23.     cout << kolku << endl;
  24.    return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement