Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. // B05-A02-Einmaleins.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <iomanip>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. int zeile=1,spalte=1,zmax;
  12.  
  13. cout << "Einmaleinsausgabe" << endl;
  14. cout << "Anzahl der Zeilen :";
  15. cin >> zmax;
  16.  
  17. /* do
  18. {
  19. cout << setw(4) << zeile*spalte;
  20.  
  21. spalte++;
  22.  
  23. if (zmax<spalte)
  24. {
  25. spalte = 1;
  26. cout << endl;
  27. zeile++;
  28. }
  29.  
  30. } while (zeile <= zmax );
  31.  
  32. */
  33.  
  34. for (spalte=1; spalte<= zmax; spalte=spalte+1)
  35. {
  36. cout << setw(4) << zeile*spalte;
  37.  
  38. if (zmax<spalte)
  39. {
  40. spalte = 1;
  41. cout << endl;
  42. zeile++;
  43. }
  44.  
  45. }
  46.  
  47.  
  48.  
  49. system("pause");
  50.  
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement