All pastes #260064 Raw Edit

Something

public cpp v1 · immutable
#260064 ·published 2006-11-28 00:02 UTC
rendered paste body
#include <iostream>#include <cmath>using namespace std;int main (void){        int faktor = 2;        double zahl;        cout << "Eine ganze Zahl eingeben: " << endl;        cin >> zahl;        if (zahl != (int) zahl)        {                cout << " Das ist keine ganze Zahl!" << endl;        }        else        {                int zahlI=(int) zahl;                cout << "Primfaktoren: " << endl;                do                {                        int rest;                        rest = zahlI % faktor;                        if (rest == 0)                        {                                cout << faktor << endl;                                zahlI = zahlI / faktor;                                faktor = 2;                        }                        else                        {                                faktor = faktor + 1;                        }                }                while ( faktor <= sqrt(zahl));                cout << zahlI << endl;        }}