Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main(){
- int A,B,C,D,E,ans = 0;;
- cin >> A >> B >> C >> D >> E;
- if(A < 0){
- while(A != 0){
- ans += C;
- A++;
- }
- }
- if(A==B){
- cout << ans << endl;
- return 0;
- }
- if(A == 0){
- ans += D;
- }
- ans += (B-A) * E;
- cout << ans << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement