Advertisement
Guest User

21

a guest
Aug 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.03 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <Windows.h>
  3. #include <xkeycheck.h>
  4.  
  5. typedef  struct money {
  6.     int project, //1 project = 100 kuchmarks
  7.         kuchmark;
  8. } money;
  9. typedef struct boosters{
  10.     int num_kafedra;
  11.  
  12.  
  13.  
  14. } boosters;
  15. money g_Money = { 0,100 }; boosters g_Boosters = { 0 };
  16.  
  17. //Объявление ф-ий
  18. void CUI(int);
  19. void feedback();
  20.  
  21.  
  22. /*
  23. double dtime() {
  24.     double t;
  25.     struct timeval tv;
  26.     gettimeofday(&tv, NULL);
  27.     t = tv.tv_sec + ((double)tv.tv_usec) / 1e6;
  28.     return t;
  29. }
  30. */
  31. //system(cls);
  32. int main() {
  33.     int hours = 0;
  34.     while (0 < 1) {
  35.         CUI(&hours);
  36.         feedback();
  37.     }
  38.  
  39.     return 0;
  40. }
  41.  
  42. void CUI(int *hours) {
  43.     system("cls");
  44.     printf("#######################################\n");
  45.     printf("#         SIMULYATOR MDKCshnika       #\n");
  46.     printf("#######################################\n");
  47.     printf("# project   = %2.d |                    #\n", g_Money.project );
  48.     printf("# kukhmarks = %2.d |                    #\n", g_Money.project);
  49.     printf("# ----------------                    #\n"); //
  50.     printf("#                                     #\n");
  51.     printf("#                                     #\n");
  52.     printf("#                                     #\n");
  53.     printf("#                                     #\n");
  54.     printf("#                                     #\n");
  55.     printf("#                                     #\n");
  56.     printf("#                                     #\n");
  57.     printf("#                                     #\n");
  58.     printf("#                                     #\n");
  59.     printf("#                                     #\n");
  60.     printf("#                                     #\n");
  61.     printf("#                                     #\n");
  62.     printf("#                                     #\n");
  63.     printf("#  hours: %2.d                         #\n", *(hours));
  64.     printf("#                                     #\n");
  65.     printf("#######################################\n\n\n\n\n");
  66.     *hours = *hours + 1;
  67.     Sleep(10);
  68. }
  69.  
  70. void feedback() {
  71.     int a;
  72.     scanf_s("%d", a);
  73.     switch (a) {
  74.     case '1':
  75.         g_Boosters.num_kafedra++;
  76.     }
  77.  
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement