Multiplication Table
Lektion 14 von 25 im Kurs Coding Problems: Teil 2 von Coddy.
Sie erhalten eine einzelne Zahl und Ihre Aufgabe ist es, das Einmaleins bis zu dieser Zahl auszugeben.
| 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | 5 | 6 |
| 2 | 2 | 4 | 6 | 8 | 10 | 12 |
| 3 | 3 | 6 | 9 | 12 | 15 | 18 |
| 4 | 4 | 8 | 12 | 16 | 20 | 24 |
| 5 | 5 | 10 | 15 | 20 | 25 | 30 |
| 6 | 6 | 12 | 18 | 24 | 30 | 36 |
Aufgabe
MittelSchreiben Sie ein Programm, das von der Standardeingabe eine natürliche Zahl N (N < 100) liest und die Multiplikationstabelle bis zu dieser Zahl ausgibt. Geben Sie 3 Leerzeichen zwischen jeder Zahl und 4 Leerzeichen am Anfang der ersten Zeile aus.
Eingabe
5
Ausgabe
1 2 3 4 5
1 1 2 3 4 5
2 2 4 6 8 10
3 3 6 9 12 15
4 4 8 12 16 20
5 5 10 15 20 25
Probier es selbst
#include <stdio.h>
int main() {
// Code hier schreiben
return 0;
}
Alle Lektionen in Coding Problems: Teil 2
1Course Introduction
Introduction3Medium Difficulty
NumbersPositionsEncryptionMultiplication TableSmall Large PalindromeBingoGreatest DivisorsArt