Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, p, x, y, s;
- cout << "N = ";
- cin >> n;
- cout << "p = ";
- cin >> p;
- cout << "x = ";
- cin >> x;
- cout << "y = ";
- cin >> y;
- cout << "s = ";
- cin >> s;
- double frst = (1 - (double)x / 100);
- double scnd = (1 + (double)y / 100);
- for(int i = 1; i <= s; i++)
- {
- if(i <= p)
- {
- n *= frst;
- }
- else n *= scnd;
- }
- cout << n;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement