
Daevyupla
6 год назад
Написать программу на С++.. буду очень рада помощи

ОТВЕТЫ

Milana
Oct 24, 2020
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double x, y;
cout << "x = ";
cin >> x;
if (x != 0) {
y=x+1/x;
cout << "y = " << fixed << setw (7) << y;
}
else cout << "no solution";
}
Пример:
x = 25
y = 25.040000
#include <iomanip>
using namespace std;
int main() {
double x, y;
cout << "x = ";
cin >> x;
if (x != 0) {
y=x+1/x;
cout << "y = " << fixed << setw (7) << y;
}
else cout << "no solution";
}
Пример:
x = 25
y = 25.040000
554
Смежные вопросы: