Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <math.h>
  4. #include <stdlib.h>
  5. using namespace std;
  6.  
  7. void main()
  8. {       setlocale(0,"");
  9.         float massx[2];
  10.         float a = 0.75;
  11.         float b = 4.5;
  12.         float n = -1.5;
  13.         float m = 2.5;
  14.         float u = 0.5;
  15.         float i, x;
  16.         int count=0;
  17.         cout <<"Ax+Bcosb=0\n";
  18.         cout <<"Переменная A = 0.75\n";
  19.         cout <<"Переменная B = 4.5\n";
  20.         cout <<"Диапозон: \n";
  21.         cout <<"b начало = -1.5\n";
  22.         cout <<"b конец = 2.5\n";
  23.         cout <<"Шаг "<< char(30)<<"b = 0.5\n";
  24.         cout <<"Решения уравнения:\n";
  25.         for(i=n;i<=m;i+=u)
  26.             {
  27.                 x=(-b*cos(i))/a;
  28.                 cout <<"x = "<<x<<endl;
  29.                 if(x>0)
  30.                     {
  31.                         massx[count]=sqrt(1+x);
  32.                         count++;
  33.                     }
  34.                 }
  35.         cout<<"Массив Z:"<<endl;
  36.         for(int k=0;k<2;k++)
  37.         {
  38.             cout<<massx[k]<<' ';
  39.         }
  40.                         getch();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement