MrDj200

Stuff

Oct 4th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <Windows.h>
  4.  
  5. int main(void)
  6. {
  7.     char charIn;
  8.  
  9.     start:
  10.     system("cls");
  11.     system("color 0a");
  12.     system("title Handelsrechner                                                                                              MrDj 2015");
  13.     printf("Was m\x94\chtest du machen?\n\n");
  14.     printf("[1] Neue Handelsdaten\n");
  15.     printf("[C] Das Programm schliessen\n");
  16.     printf("Eingabe: ");
  17.     scanf("%c", &charIn);
  18.     fflush(stdin);
  19.  
  20.     switch( charIn  )   {
  21.  
  22.         case '1':
  23.             newTrade();
  24.             break;
  25.         case 'd':
  26.             writeFile();
  27.             break;
  28.         case 'c':
  29.             killProgramm();
  30.             break;
  31.         case 'C':
  32.             killProgramm();
  33.             break;
  34.         default:
  35.             system("cls");
  36.             printf("Unknown Option: \"%c\" \n! Please try again!\n", charIn);
  37.             system("pause");
  38.             goto start;
  39.             break;
  40.  
  41.     }
  42.  
  43.     system("PAUSE");
  44.     return 0;
  45. }
  46.  
  47. int newTrade(void)  {
  48.  
  49.     char charCurrentSystem[100], charCurrentStation[100];
  50.     char charCurrentCargoSelling[100], charCurrentCargoSellingWeight[100];
  51.     char charCurrentCargoBuying[100], charCurrentCargoBuyingWeight[100];
  52.  
  53.     system("cls");
  54.  
  55.     printf("Aktuelles System\n");
  56.     printf("    >>");
  57.     scanf("%s", &charCurrentSystem);
  58.     fflush(stdin);
  59.  
  60.     printf("\n");
  61.  
  62.     printf("Aktuelle Station\n");
  63.     printf("    >>");
  64.     scanf("%s", &charCurrentStation);
  65.     fflush(stdin);
  66.  
  67.     printf("\n");
  68.     printf("\n");
  69.  
  70.     printf("Aktueller Fracht-ankauf\n");
  71.     printf("    >>");
  72.     scanf("%s", &charCurrentCargoBuying);
  73.     fflush(stdin);
  74.  
  75.     printf("\n");
  76.  
  77.     printf("Aktuelles Fracht-ankauf Gewicht (in t)\n");
  78.     printf("    >>");
  79.     scanf("%s", &charCurrentCargoBuyingWeight);
  80.     fflush(stdin);
  81.  
  82.     printf("\n");
  83.     printf("\n");
  84.  
  85.     printf("<|>%s / %s \n      >%s  %st\n\n", charCurrentStation, charCurrentSystem, charCurrentCargoBuying, charCurrentCargoBuyingWeight);
  86.  
  87.     system("PAUSE");
  88.     main();
  89.  
  90. }
  91.  
  92. int writeFile(void) {
  93.  
  94.     char* charUsername;
  95.     char* charDate;
  96.  
  97.     charUsername = getenv("USERNAME");
  98.  
  99.     system("cls");
  100.  
  101.     //printf("Name: %s \nDatum: %s", charUsername, charDate);
  102.     SYSTEMTIME str_t;
  103.     GetSystemTime(&str_t);
  104.  
  105.     printf("%d.%d.%d\n", str_t.wDay, str_t.wMonth, str_t.wYear);
  106.  
  107. }
  108.  
  109. int killProgramm(void) {
  110.  
  111.     system("cls");
  112.     system("pause");
  113.     printf("\n\n!!!!ELITE: DANGEROUS IST GEIL!!!!\n\n");
  114.     system("exit");
  115.  
  116. }
Advertisement
Add Comment
Please, Sign In to add comment