Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale.h>
- using namespace std;
- int main(void){
- int t1, t2, t3;
- double v1, v2, v3, s1, s2, s3, s;
- setlocale(LC_ALL, "Russian");
- cout<<"введите t1 в минутах и скорость в км/м:";
- cin>>t1>>v1;
- cout<<"Введите фремя 2 в мин. и скорость 2 в км/м:";
- cin>>t2>>v2;
- cout<<"Введите время 3 в мин. и скорость 3 с км/м:";
- cin>>t3>>v3;
- s1=t1*v1;
- s2=t2*v2;
- s3=t3*v3;
- s=s1+s2+s3;
- s=s/2.0;
- if (s1>=s)
- cout<<"Ответ:"<<s/v1<<endl;
- else if (s1+s2>=s)
- cout<<"Ответ:"<<((s-s1)/v2+t1)<<endl;
- else cout<<"Ответ:"<<((s-s1-s2)/v3+t1+t2)<<endl;
- //system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment