C++ :: Aufgabe #275 :: Lösung #1
3 Lösungen
#275
Das kleine Einmaleins
Anfänger - C++
von DragStar
- 06.04.2020 um 08:32 Uhr
Erstellen Sie ein Programm, welches das kleine Einmaleins in der Form
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 ...
.
.
.
10 20 30 40 50 60 70 80 90 100
ausgibt.
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 ...
.
.
.
10 20 30 40 50 60 70 80 90 100
ausgibt.
#1
von JKooP (18090 Punkte)
- 12.04.2020 um 16:10 Uhr
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
cout << " |";
for (int i = 1; i < 11; i++)
cout << setw(4) << i;
cout << "\n";
cout << string(46, '-') << "\n";;
for (int k = 1; k < 11; k++)
{
cout << setw(4) << k << " |";
for (int j = 1; j < 11; j++)
cout << setw(4) << k*j;
cout << "\n";
}
}
Kommentare:
Für diese Lösung gibt es noch keinen Kommentar
Seite 1 von 0
1
