Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1. Start
- #include <iostream>
- #include <cmath>
- double bisectrix (double a, double b, double c){
- double La = (sqrt(b*c*((b+c)*(b+c)-a*a)/(b+c);
- return La;
- }
- int main(){
- double a,b,c;
- cin>>a>>b>>c;
- double La = bisectrix(a,b,c),
- Lb = bisectrix(b,c,a),
- Lc = bisectrix(c,a,b);
- cout << La << Lb << Lc;
- }
- // 1. End
- // 2. Start
- #include <iostream>
- #include <cmath>
- void Razv(double x, double& t){
- if(x<=0.0){
- t=x*x;
- double temp = sin(x*x);
- double temp1 = log(x);
- if(temp>t) t = temp;
- if(temp1>t) t = temp1;
- }
- if(x>=4.0){
- t=sqrt(abs(x));
- double temp = exp(-x);
- double temp1 = cos(x)*cos(x)*cos(x);
- double temp2 = sin(x*x*x);
- double temp3 = pow(2*x,1.0/3.0);
- if(temp<t) t = temp;
- if(temp1<t) t = temp1;
- if(temp2<t) t = temp2;
- if(temp3<t) t = temp3;
- }
- if(x>0.0 and x<4.0) t = 1;
- }
- int main(){
- double x,t;
- cin >> x;
- Razv(x,t);
- cout << t;
- }
- // 2. End
- // 3. Start
- void Calc(double x, double epsilon, double& res){
- double a = - x*x*x*x/2;
- int i = 1;
- while(abs(a) > epsilon){
- res+=a;
- i++;
- a*= - (x*x) / ( (3*i-1) * (3*i-2) * (3*i-3) );
- }
- }
- int main() {
- double x,res,epsilon;
- res = 0;
- cin >> x >> epsilon;
- Calc(x,epsilon, res);
- cout << res;
- }
- // 3. End
- // 4. Start
- #include <iostream>
- #include <cmath>
- double func(double x) {
- return (cos(10.5*x - 3));
- }
- void RegCikl(double a, double b, double h, int& count){
- double x,y;
- int n = ceil((b-a)/h)+1;
- for (int i = 1; i<=n; ++i){
- x = a+(i-1)*h;
- y = func(x);
- if(y>0.0) count++;
- }
- }
- int main() {
- double a,b,h;
- int count = 0;
- RegCikl(a,b,h,count);
- cout << count;
- }
- // 4. End
- // 5. Start
- #include <iostream>
- #include <cmath>
- double func (double x, double y){
- return (x*y*y+exp(-2*x));
- }
- double VlozhCikl (double a, double b, double hx, double c, double d, double dy, double& max){
- int n = ceil((b-a)/hx)+1;
- int m = ceil((d-c)/hy)+1;
- double x,y,z,sum=0;
- for(int i = 1; i<=n; ++i){
- x = a+(i-1)*hx;
- for(int j = 1; j<=m; ++j){
- y = c+(j-1)*hy;
- z = func(x,y);
- if(z>max) max = z;
- sum += z;
- }
- }
- return sum;
- }
- int main(){
- double a,b,hx,c,d,hy,max = -1.7e308;
- double sum = VlozhCikl(a,b,hx,c,d,hy,max);
- cout << sum << max;
- }
- // END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement