Guest User

Untitled

a guest
Nov 19th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <locale.h>
  3. using namespace std;
  4. int main(void){
  5. int t1, t2, t3;
  6. double v1, v2, v3, s1, s2, s3, s;
  7. setlocale(LC_ALL, "Russian");
  8. cout<<"введите t1 в минутах и скорость в км/м:";
  9. cin>>t1>>v1;
  10. cout<<"Введите фремя 2 в мин. и скорость 2 в км/м:";
  11. cin>>t2>>v2;
  12. cout<<"Введите время 3 в мин. и скорость 3 с км/м:";
  13. cin>>t3>>v3;
  14. s1=t1*v1;
  15. s2=t2*v2;
  16. s3=t3*v3;
  17. s=s1+s2+s3;
  18. s=s/2.0;
  19. if (s1>=s)
  20. cout<<"Ответ:"<<s/v1<<endl;
  21. else if (s1+s2>=s)
  22. cout<<"Ответ:"<<((s-s1)/v2+t1)<<endl;
  23. else cout<<"Ответ:"<<((s-s1-s2)/v3+t1+t2)<<endl;
  24. //system("pause");
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment