Advertisement
jelyslime

ven zadacha n2

Jan 27th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. void venLike(int obsht,int p,int h,int t,int th , int pt , int hp)
  7. {
  8. int tempt = t - th;
  9. int temph = h - th;
  10. int ptItIh = tempt + temph + th;
  11. int ostatuk = obsht - ptItIh;
  12. hp = p - ostatuk;
  13. cout << "HP = " << hp;
  14. }
  15.  
  16.  
  17.  
  18. int main()
  19. {
  20. //zadacha tip ven oiler 2
  21. //
  22.  
  23. int obsh, p, h, t, th, pt, hp; //tursi se HP
  24. pt = 0;
  25. hp = 0;
  26. cout << " vuvedete obsht broi,P,H,T,TH" << endl;
  27. cin >> obsh >> p >> h >> t >> th;
  28. cout << "Obshto = " << obsh << ", P = " << p << ", T = " << t << ", TH = " << th << ", Pt = " << pt << endl;
  29. cout << "Namirane na HP" << endl;
  30. venLike(obsh, p, h, t, th, pt, hp);
  31.  
  32.  
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement