Advertisement
Guest User

Untitled

a guest
Jun 25th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <conio.h>;
  2. #include <iostream>;
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     cout<<"Soprotivlenie"<<endl;
  8.     int r1,r2,rps,q;
  9.     float rpr;
  10.     cout<<"Vvedite soprotivleniya R1 i R2:";
  11.     cin>>r1>>r2;
  12.     cout<<"Parallell'no ili posledavatel'no?(0,1):"<<endl;
  13.     cin>>q;
  14.     rpr=r1*r2/(r1+r2);
  15.     rps=r1+r2;
  16.     if(q==0){
  17.             cout<<"R="<<rpr;
  18.         }
  19.         else{
  20.                 cout<<"R="<<rps;
  21.             }
  22.     getch();
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement