Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // B05-A02-Einmaleins.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- int zeile=1,spalte=1,zmax;
- cout << "Einmaleinsausgabe" << endl;
- cout << "Anzahl der Zeilen :";
- cin >> zmax;
- /* do
- {
- cout << setw(4) << zeile*spalte;
- spalte++;
- if (zmax<spalte)
- {
- spalte = 1;
- cout << endl;
- zeile++;
- }
- } while (zeile <= zmax );
- */
- for (spalte=1; spalte<= zmax; spalte=spalte+1)
- {
- cout << setw(4) << zeile*spalte;
- if (zmax<spalte)
- {
- spalte = 1;
- cout << endl;
- zeile++;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement