Wenn ich in C++ dieses Programmiere erscheint folgene Fehlermeldung.



  • #include <iostream>

    using namespace std;

    int main()

    {
    int a, b, c, d, e, f, g;

    for (a = 0; a <= 9; a++)
    {
    for (b = 0; b <= 9; b++)
    {
    for (c = 0; c <= 9; c++)
    {
    for (d = 0; d <= 9; d++)
    {
    for (e = 0; e<= 9; e++)
    {
    for (f = 0; f<= 9; f++)
    {
    for (g = 0; g<= 9; g++)
    {

    if ((a * 1000 + b * 100 + c * 10 + d) / (e * 10 + f) == (e*100+g*10+d))
    {
    cout << "Lösung " << "Gefunden!" << endl;
    cout << "a=" << a << endl;
    cout << "b=" << b << endl;
    cout << "c=" << c << endl;
    cout << "d=" << d << endl;
    cout << "e=" << e << endl;
    cout << "f=" << f << endl;
    cout << "g=" << g << endl;

    }

    }
    }
    }

    }
    }
    }
    }

    system("PAUSE");
    return 0;

    }

    Fehlermeldung: Unbehandelte Ausnahme bei 0x00F04FEA in BrutForce.exe: 0xC0000094: Integer division by zero
    Woran liegt es?



  • Die Division durch 0 ist verboten.


Log in to reply