gets (S) S Enter, .. , .
scanf ( , );
, , ID &, . () & . % s .
int , double b, char str [20]:
scanf ("%d %ℓf %s", &a, &b, str);
, .
math.h. double.
. , 2 p () 360 ().
ID | ID | ||
sqrt(x) | arcsin(x) | asin(x) | |
|x| | fabs(x) | arctg(x) | atan(x) |
ex | exp(x) | arctg(x/y) | atan2(x,y) |
xy | pow(x, y) | sh*(x)=1/2 (ex-e-x) | sinh(x) |
ln(x) | log(x) | ch(x)=1/2 (ex+e-x) | cosh(x) |
lg10(x) | log10(x) | tgh(x) | tanh(x) |
sin(x) | sin(x) | x y | fmod(x,y) |
cos(x) | cos(x) | ceil(x) | |
tg(x) | tan(x) | floor(x) |
C x, y, z:
.
Visual C++ 6.0 4 5 [1].
Builder C++ 6.0 , [3].
1. -, :
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main()
{
double x, y, z, a, b,c, rez;
puts("\n\t x, y, z = ");
scanf("%lf %lf %lf", &x, &y, &z); // double ℓf
a = pow(tan(x+y),2);
b = exp(y-z);
c = sqrt(cos(x*x)+sin(z*z));
rez = a-b*c;
printf("\n x = %7.3lf\n y = %7.3lf\n z = %7.3lf\nRezult = %lf\n", x, y, z, rez);
puts("Press any key... ");
getch();
return 0;
}
2. -, :
#include <iostream.h>
#include <conio.h>
#include <math.h>
int main()
{
double x, y, z, a, b,c, rez;
cout << "\n\t x,y,z = " << endl;
cin >> x >> y >> z;
a = pow(tan(x+y),2);
b = exp(y-z);
|
|
c = sqrt(cos(x*x)+sin(z*z));
rez = a-b*c;
cout << "\n x = " << x << "\n y = " << y << "\n z = " << z
<< "\nRezult = " << rez << endl;
cout << "Press any key... " << endl;
getch();
return 0;
}
x = 3,4; y = 7,4×10-2; z = 1,943×102 ( z ), :
. .
1. . | x = 14.26, y = 1.22, z = 3.5´10-2 t = 0.564849. 0.566691 |
2. . | x = 4.5, y = 0.75´10-4, z = 0.845´102 u = 55.6848. |
3. . | x = 3.74´10-2, y = 0.825, z = 0.16´102 v = 1.0553. |
4. . | x = 0.4´104, y = 0.875, z = 0.475´10-3 w = 1.9873. |
5. | x = 15.246, y = 4.642´10-2, z = 20.001´102 a = 182.036. |
6. | x = 16.55´10-3, y = 2.75, z = 0.15 b = 38.902. 40.6307 |
7. | x = 0.1722, y = 6.33, z = 3.25´10-4 g = 172.025. 205.306 |
8. | x = 2.235´10-2, y = 2.23, z = 15.221 j = 39.374. |
9. . | x = 1.825´102, y = 18.225, z = 3.298´10-2 y = 1.2131. |
10. | x = 3.981´10-2, y = 1.625 ´ ´103, z = 0.512 a = 1.26185. |
11. | x = 6.251, y = 0.827, z = 25.001 b = 0.7121. |
12. | x = 3.251, y = 0.325, z = 0.466´10-4 c = 4.025. 4.25143 |
13. . | x = 17.421, y = 10.365´10-3, z = 0.828´105 f = 0.33056. |
14. . | x = 12.3´10-1, y = 15.4, z = 0.252´103 g = 82.8257. 187.345 |
15. . | x = 2.444, y = 0.869´10-2, z = 0.13´103 h = 0.49871. |
16. | x = 2.235´10-2, y = 2.23, z = 15.221 w = 39.374. |
2.
: , , if, switch, break. .