Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- using namespace std;
- int main()
- {
- double cena, pari;
- cin >> cena >> pari;
- int kolku = 0;
- for(double i = 0.0; i <= (pari - cena); i++) {
- if((int) (i + cena) % 5 == 0) {
- double procent = i / (i + cena);
- procent *= 100.0;
- if(procent > 10) break;
- if(procent >= 5 and procent <= 10) {
- kolku++;
- }
- }
- }
- cout << kolku << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement