Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. int A,B,C,D,E,ans = 0;;
  5. cin >> A >> B >> C >> D >> E;
  6. if(A < 0){
  7. while(A != 0){
  8. ans += C;
  9. A++;
  10. }
  11. }
  12. if(A==B){
  13. cout << ans << endl;
  14. return 0;
  15. }
  16. if(A == 0){
  17. ans += D;
  18. }
  19. ans += (B-A) * E;
  20. cout << ans << endl;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement