@Chainyk
15 / 15 / 1
Регистрация: 24.08.2010
Сообщений: 94
|
26.09.2010, 23:58
|
|
Не понимаю что такое "Определить разность". Сделал вот так:
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| #include "stdafx.h"
#include <stdio.h>
#include <math.h>
int _tmain(int argc, _TCHAR* argv[])
{
double x,y,z;
printf ("Input x: ");
scanf ("%f", &x);
y = cos(x)+cos(2*x)+cos(6*x)+cos(7*x);
z = 4*cos(x/2)*cos(5/2*x)*cos(4*x);
printf ("Distance from z to x: %f\n", abs(z-y));
return 0;
} |
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| #include "stdafx.h"
#include <iostream>
#include <math.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double x,y,z;
cout<<"Input x: ";
cin>>x;
y = cos(x)+cos(2*x)+cos(6*x)+cos(7*x);
z = 4*cos(x/2)*cos(5/2*x)*cos(4*x);
cout<<"Distance from z to x: "<<abs(z-y)<<endl;
return 0;
} |
|
0
|