Untitled
unknown
c_cpp
3 years ago
443 B
1
Indexable
Never
#include <iostream> #include "modul.h" using namespace std; void felCserel(double& a, double& b) { double aux = a; a = b; b = aux; } void init(double a, double b) { v = new double[2]{}; if (a > b) felCserel(a, b); v[0] = a; v[1] = b; } void felsz() { delete[] v; } void duplaz() { double c = (v[0] + v[1]) / 4.0; v[0] -= c; v[1] += c; } void kiir() { cout << v[0] << ' ' << v[1]; }