HyperSensualNarwhal

Pythagorean table

Dec 9th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using std::cout;
  4. using std::cin;
  5. using std::endl;
  6.  
  7. void main()
  8. {
  9.  
  10. // Таблица умножения
  11.  
  12.     for (int n = 9, i = 1; i <= n; i++)
  13.     {
  14.         for (int j = 1; j <= n; j++)
  15.         {
  16.             cout << i << " * " << j << " = ";
  17.             cout << i * j << endl;
  18.         }
  19.         if (i % n != 0) cout << endl;
  20.     }
  21.  
  22.  
  23. //Таблица Пифагора
  24. /*cout << "\t    Pythagorean table" << endl << endl;
  25.     for (int i = 1, n = 10; i <= n; i++)
  26.     {
  27.    
  28.         for (int j = 1; j <= n ; j++)
  29.         {      
  30.             if ((i * j) < 10) cout << " ";
  31.             if ((i * j) < 100) cout << " ";
  32.             cout << i * j << " ";
  33.         }
  34.  
  35.         cout << endl << endl;
  36.     }*/
  37.    
  38. }
Add Comment
Please, Sign In to add comment