Кодяра:
#include <iostream>
double F(double x) {
if (x < 10.3)
return 3*x;
else
return 2*x;
}
void print_f(double x) {
std::cout << "x=" << x << "; F(x)=" << F(x) << std::endl;
int main() {
for (double x = 5; x < 15; x += 4.3)
print_f(x);
return 0;
Кодяра:
#include <iostream>
double F(double x) {
if (x < 10.3)
return 3*x;
else
return 2*x;
}
void print_f(double x) {
std::cout << "x=" << x << "; F(x)=" << F(x) << std::endl;
}
int main() {
for (double x = 5; x < 15; x += 4.3)
print_f(x);
return 0;
}