Quipex

zadanie_1_XIII

Oct 22nd, 2015
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. // zadanie_1_XIII.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11.     cout<<"S pomoshju cin/cout:\n";
  12.     double a,b,z,y,razn;
  13.     cout<<endl<<"Vvedite a i b:\n";
  14.     cout<<">>";
  15.     cin>>a>>b;
  16.     y=(sin(a)+cos(2*b-a))/cos(a)-sin(2*b-a);
  17.     z=(1+sin(2*b))/cos(2*b);
  18.     razn=abs(y-z);
  19.     cout<<"\nRaznost="<<razn<<endl;
  20.  
  21.     cout<<endl<<"S pomoshju scanf/printf:\n";
  22.    
  23.     printf("Vvedite a i b:\n");
  24.     printf(">>");
  25.     scanf("%f, %f", &a, &b);
  26.     y=(sin(a)+cos(2*b-a))/cos(a)-sin(2*b-a);
  27.     z=(1+sin(2*b))/cos(2*b);
  28.     razn=abs(y-z);
  29.     printf("\nRaznost=%f", razn);
  30.     cout<<endl;
  31.  
  32.     system("pause");
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment