@FunDuck
688 / 379 / 4
Регистрация: 22.01.2009
Сообщений: 1,135
|
05.06.2009, 22:41
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| #include <iostream>
#include <math.h>
using namespace std;
#define a 0
#define b 4
#define h 1
void main(){
float x = a;
int i = 0;
float X[int((b-a)/h) + 1], Y[int((b-a)/h) + 1];
while (x <= b){
X[i] = x;
Y[i] = sin(2*x) - cos(2*x);
x += h;
++i;
}
for (int j = 0; j < int((b-a)/h) + 1; j++)
cout << X[j] << '|' << Y[j] << '\n';
} |
|
1
|