Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- double a, b, h, y;
- double eps = 1e-12;
- cin >> a >> b >> h;
- for (double i = a; i < b + eps; i += h) {
- cout << fixed << setprecision(6) << i << '\t';
- if (abs(abs(i) - 1) < eps) cout << "undefined" << endl;
- else cout << fixed << setprecision(6) << 1 / (i * i - 1) << endl;
- }
- return 0;
- }
- /*
- struct point {
- int x, y, z;
- };
- int perimetr(point a, point b, point c) {
- double ot1, ot2, ot3, p;
- ot1 = sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) + (a.z - b.z) * (a.z - b.z));
- ot2 = sqrt((b.x - c.x) * (b.x - c.x) + (b.y - c.y) * (b.y - c.y) + (b.z - c.z) * (b.z - c.z));
- ot3 = sqrt((a.x - c.x) * (a.x - c.x) + (a.y - c.y) * (a.y - c.y) + (a.z - c.z) * (a.z - c.z));
- p = ot1 + ot2 + ot3;
- return p;
- }
- int main() {
- int n, p;
- double m_p = 1e9;
- setlocale(LC_ALL, "Russian");
- cout << "Количество точек >> ";
- cin >> n;
- vector <point> toch;
- for (int i = 0; i < n; i++) {
- cout << "Введите координаты точки\n x = ";
- cin >> toch[i].x; // здесь ошибка
- cout << "y = ";
- cin >> toch[i].y;
- cout << "z = ";
- cin >> toch[i].z;
- }
- for (int i = 0; i < n - 2; i++) {
- for (int j = i + 1; i < n - 1; i++) {
- for (int k = j + 1; k < n; k++) {
- p = perimetr(toch[i], toch[j], toch[k]);
- if (m_p < p) m_p = p;
- }
- }
- }
- cout << m_p;
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement