funktioniert
This commit is contained in:
parent
aafbd8a4e0
commit
122dcd5a02
62
laugsaeu.c
Normal file
62
laugsaeu.c
Normal file
@ -0,0 +1,62 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
typedef enum {
|
||||
NATRONLAUGE,
|
||||
KALILAUGE,
|
||||
KALKWASSER,
|
||||
ANZAHL_LAUGEN
|
||||
} Lauge;
|
||||
|
||||
|
||||
typedef enum {
|
||||
SALZSAEURE,
|
||||
SCHWEFELSAEURE,
|
||||
SALPETERSAEURE,
|
||||
KOHLENSAEURE,
|
||||
ANZAHL_SAEUREN
|
||||
} Saeure;
|
||||
|
||||
|
||||
const char* mischtabelle[ANZAHL_LAUGEN][ANZAHL_SAEUREN] = {
|
||||
{"Natriumchlorid", "Natriumsulfat", "Natriumnitrat", "Natriumcarbonat"},
|
||||
{"Kaliumchlorid", "Kaliumsulfat", "Kaliumnitrat", "Kaliumcarbonat"},
|
||||
{"Calciumchlorid", "Calciumsulfat", "Calciumnitrat", "Calciumcarbonat"}
|
||||
};
|
||||
|
||||
const char* laugen_namen[ANZAHL_LAUGEN] = {
|
||||
"Natronlauge",
|
||||
"Kalilauge",
|
||||
"Kalkwasser"
|
||||
};
|
||||
|
||||
const char* saeure_namen[ANZAHL_SAEUREN] = {
|
||||
"Salzsäure",
|
||||
"Schwefelsäure",
|
||||
"Salpetersäure",
|
||||
"Kohlensäure"
|
||||
};
|
||||
|
||||
int main() {
|
||||
printf(" ||");
|
||||
for (int s = 0; s < ANZAHL_SAEUREN; s++) {
|
||||
printf(" %-14s|", saeure_namen[s]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("-----------++");
|
||||
for (int s = 0; s < ANZAHL_SAEUREN; s++) {
|
||||
printf("---------------|");
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
|
||||
for (int l = 0; l < ANZAHL_LAUGEN; l++) {
|
||||
printf("%-11s||", laugen_namen[l]);
|
||||
for (int s = 0; s < ANZAHL_SAEUREN; s++) {
|
||||
printf(" %-14s|", mischtabelle[l][s]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user