mercredi 27 février 2019

Three sister while loops nested within 3 classes

Problem with starting the program!

Hi, I'm supposed to build a learning engine. This is the first part of it and what it's supposed to do is give me massive numbers so I can hook other programs to it's none existeble numbers. However, I'm having a problem with not being able to launch and to execute the program. I wonder what the problem may be?

#include <iostream>
#include <string>
using namespace std;

class A1 {

   void LooP1() {

      int a1 = 2;
      int a2 = 4;
      int a3 = 6;

      while (true) {

          a1 = a1 + a2;
          a2 = a2 + a3;
          a3 = a3 + a1;

          cout << a1 << a2 << a3 << endl;
      }
   }
};

class B1 {

   void LooP2() {

      int a1 = 8;
      int a2 = 10;
      int a3 = 12;

      while (true) {

          a1 = a1 + a2;
          a2 = a2 + a3;
          a3 = a3 + a1;

          cout << a1 << a2 << a3 << endl;
      }
   }
};


class C1 {

   void LooP3() {

      int a1 = 14;
      int a2 = 16;
      int a3 = 18;

      while (true) {

          a1 = a1 + a2;
          a2 = a2 + a3;
          a3 = a3 + a1;

          cout << a1 << a2 << a3 << endl;
      }
   }
};

void main() {

    A1 A;
    A.LooP1;

    B1 B;
    B.LooP2;

    C1 C;
    C.LooP3;

}

Aucun commentaire:

Enregistrer un commentaire