1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35:
| #include <stdio.h> #include <stdlib.h> #include <time.h>
int main(void) { int i, ht1, ht2, ht3, ht4, ht5, ht6, at1, at2, at3, at4, at5, at6;//Variablen aufzählen ht1=rand() % 4;//Variablen definieren ht2=rand() % 4; ht3=rand() % 4; ht4=rand() % 4; ht5=rand() % 4; ht6=rand() % 4; at1=rand() % 4; at2=rand() % 4; at3=rand() % 4; at4=rand() % 4; at5=rand() % 4; at6=rand() % 4; time_t t;
time(&t);
srand((unsigned)time(NULL)); /* Zufallsgenerator initialisieren */
printf("Hertha BSC %i:%i Hamburger SV\n", ht1, at1); printf("BSC Jena %i:%i TSV Zarpen\n", ht2, at2);//Ergebnis ausgeben system("PAUSE"); printf("\nHertha BSC %i:%i BSC Jena\n", ht3, at3); printf("Hamburger SV %i:%i TSV Zarpen\n", ht4, at4); system("PAUSE"); printf("\nTSV Zarpen %i:%i Hertha BSC\n", ht5, at5); printf("BSC Jena %i:%i Hamburger SV\n", ht6, at6); } |