Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <Windows.h>
- int main(void)
- {
- char charIn;
- start:
- system("cls");
- system("color 0a");
- system("title Handelsrechner MrDj 2015");
- printf("Was m\x94\chtest du machen?\n\n");
- printf("[1] Neue Handelsdaten\n");
- printf("[C] Das Programm schliessen\n");
- printf("Eingabe: ");
- scanf("%c", &charIn);
- fflush(stdin);
- switch( charIn ) {
- case '1':
- newTrade();
- break;
- case 'd':
- writeFile();
- break;
- case 'c':
- killProgramm();
- break;
- case 'C':
- killProgramm();
- break;
- default:
- system("cls");
- printf("Unknown Option: \"%c\" \n! Please try again!\n", charIn);
- system("pause");
- goto start;
- break;
- }
- system("PAUSE");
- return 0;
- }
- int newTrade(void) {
- char charCurrentSystem[100], charCurrentStation[100];
- char charCurrentCargoSelling[100], charCurrentCargoSellingWeight[100];
- char charCurrentCargoBuying[100], charCurrentCargoBuyingWeight[100];
- system("cls");
- printf("Aktuelles System\n");
- printf(" >>");
- scanf("%s", &charCurrentSystem);
- fflush(stdin);
- printf("\n");
- printf("Aktuelle Station\n");
- printf(" >>");
- scanf("%s", &charCurrentStation);
- fflush(stdin);
- printf("\n");
- printf("\n");
- printf("Aktueller Fracht-ankauf\n");
- printf(" >>");
- scanf("%s", &charCurrentCargoBuying);
- fflush(stdin);
- printf("\n");
- printf("Aktuelles Fracht-ankauf Gewicht (in t)\n");
- printf(" >>");
- scanf("%s", &charCurrentCargoBuyingWeight);
- fflush(stdin);
- printf("\n");
- printf("\n");
- printf("<|>%s / %s \n >%s %st\n\n", charCurrentStation, charCurrentSystem, charCurrentCargoBuying, charCurrentCargoBuyingWeight);
- system("PAUSE");
- main();
- }
- int writeFile(void) {
- char* charUsername;
- char* charDate;
- charUsername = getenv("USERNAME");
- system("cls");
- //printf("Name: %s \nDatum: %s", charUsername, charDate);
- SYSTEMTIME str_t;
- GetSystemTime(&str_t);
- printf("%d.%d.%d\n", str_t.wDay, str_t.wMonth, str_t.wYear);
- }
- int killProgramm(void) {
- system("cls");
- system("pause");
- printf("\n\n!!!!ELITE: DANGEROUS IST GEIL!!!!\n\n");
- system("exit");
- }
Advertisement
Add Comment
Please, Sign In to add comment