SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int main(void)
  2. {
  3.     int n, m, rest, a, b;
  4.     cout << "Gebe die erste Zahl ein:" << endl;
  5.     cin >> n;
  6.     cout << "Gebe die zweite Zahl ein" << endl;
  7.     cin >> m;
  8.     if (n > 0 && m > 0)
  9.     {
  10.         cout << "Alles okay. Berechne den ggT" << endl;
  11.        
  12.         for ( int i=1 ; i<=n ; i++)
  13.         {  
  14.             n = a;
  15.             m = b;
  16.            
  17.             rest = n % m;
  18.        
  19.             if (rest==0)
  20.             {
  21.                 a++;
  22.                 b += i;
  23.             }      
  24.         }
  25.        
  26.         cout <<  << endl;      
  27.        
  28.         return 0;
  29.     }
  30.     else {
  31.         cout << "Fehler. Programmabbruch" << endl;
  32.         return 1;
  33.     }
  34.   return 0;
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top