Heron-Verfahren
public cpp v1 · immutable#include <iostream>using namespace std;int main (){ double R, X, Y, A; cout << endl; cout << "Heron-Verfahren" << endl << endl; cout << "Gib den Radikanten ein!" << endl; cin >> R; X=1; Y=R; A=1; while ( X!=Y ) { X=1.0/2*(X+(R/X)); Y=R/X; A=A+1; printf ("%.10f | %.10f", X, Y); cout << endl; system("Pause"); } cout << "Im " << A << ". Schritt habe ich herausgefunden, dass die Wurzel von " << R << " " << X << " ist." << endl; system("Pause"); return 0;}