Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- double z = 0, z1 = -5.35, z0 = 0.75, n = 0, m = 8, h = 0.9, j = 1;
- for (int i = 1; i <= 45 && j <= m; i++) {
- z = (sqrt(2.0 + sin(z1 + z0)) + sqrt(2.0 - cos(z1 + z0)) + 1.5)*(sqrt(2.0 + sin(z1 + z0)) + sqrt(2.0 - cos(z1 + z0)) + 1.5);
- if (z < j*h && z >= (j - 1)*h) {
- cout << z << " ";
- z0 = z1;
- z1 = z;
- n++;
- j++;
- }
- else{
- z0 = z1;
- z1 = z;
- n++;
- j++;
- }
- }
- cout << n;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment