Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <math.h>
- #include <stdlib.h>
- using namespace std;
- void main()
- { setlocale(0,"");
- float massx[2];
- float a = 0.75;
- float b = 4.5;
- float n = -1.5;
- float m = 2.5;
- float u = 0.5;
- float i, x;
- int count=0;
- cout <<"Ax+Bcosb=0\n";
- cout <<"Переменная A = 0.75\n";
- cout <<"Переменная B = 4.5\n";
- cout <<"Диапозон: \n";
- cout <<"B начало = -1.5\n";
- cout <<"B конец = 2.5\n";
- cout <<"Шаг "<< char(30)<<"B = 0.5\n";
- for(i=n;i<=m;i+=u)
- {
- x=(-b*cos(i))/a;
- cout <<"x="<<x<<endl;
- if(x>0)
- {
- massx[count]=sqrt(1+x);
- count++;
- }
- }
- cout<<"Положительные элементы:"<<endl;
- for(int k=0;k<2;k++)
- {
- cout<<massx[k]<<' ';
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement