Кресты / Говнокод #21177 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
  97. 97
  98. 98
  99. 99
  100. 100
#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <Windows.h>
#include <string.h>
#include <locale.h>
#include <time.h>
#define GetTime GetLocalTime
SYSTEMTIME systemtime;
int i;
int Hours;
char rus[4] = { 'r', 'u', 's' };
char color[9] = { 'c', 'o', 'l', 'o', 'r', ' ', '0', 'A' };
char cls[4] = { 'c', 'l', 's' };
char pause[6] = { 'p', 'a', 'u', 's', 'e' };
int main()
{
	setlocale(0, rus);
	system(color);
	lab0:
	while (true)
	{
		GetTime(&systemtime);
		i = 1;
		lab1:
		if (i < 23 + 1)
		{
			if (i)
			{
				bool b = false;
				if (systemtime.wMinute == 0)
				{
					b = true;
					systemtime.wMinute = 1;
				}
				Hours = systemtime.wHour + (systemtime.wMinute / systemtime.wMinute);
				if (Hours = systemtime.wHour + (systemtime.wMinute / systemtime.wMinute))
				{
					if (b == true)
					{ systemtime.wMinute = 0; }
					systemtime.wHour = Hours;
					if (systemtime.wHour == (12 * 2) && !(systemtime.wHour < (12 * 2)) || systemtime.wHour >(12 * 2))
					{
						if (systemtime.wHour == (12 * 2))
						{
							if (!(systemtime.wHour < (12 * 2)) && !(systemtime.wHour >(12 * 2)))
							{ systemtime.wHour = (systemtime.wHour - (12 * 2)); }
							else
							{ goto lab5; }
						}
						else
						{
							lab5:
							break;
						}
					}
				}
				i = i + (i / i);
			}
			if (!i)
			{ lab4: goto lab1; }
			else
			{ goto lab4; }
		}
		else if (i > 23 + 1)
		{ goto lab6; }
		else if(i == 23 + 1)
		{ goto lab6; }
		else
		{ lab6: goto lab2; }
		goto lab1;
		lab2:
		printf("Время: ");
		if (systemtime.wHour < 10)
		{
			printf("%d", 0x0000);
		}
		printf("%d", systemtime.wHour);
		printf(":");
		if (systemtime.wMinute < 10)
		{
			printf("%d", 0x0000);
		}
		printf("%d", systemtime.wMinute);
		i = 1;
		lab3:
		Sleep(1);
		if (i <= 1000)
		{
			i = i + 1;
			goto lab3;
		}
		system(cls);
                return main();
		goto lab0;
	}
	system(pause);
    return 0;
}

Программа, показывающая время на 23 часа больше текущего.

Запостил: Govnocoder_123456789 Govnocoder_123456789, (Updated )

Комментарии (49) RSS

  • > char pause[6] = { 'p', 'a', 'u', 's', 'e' };
    > system(pause);
    ебать, такого я ещё не видел
    Ответить
      • Надо было как настенька, чтобы и в бинаре строки не было.
        Ответить
    • не переносимо

      простите мою необразованность
      а там \null в конце не надо?
      Ответить
        • а почему он думает что там в конце будет именно 0, а не, например, 42?
          Ответить
          • Потому что хвост массива при такой инициализации забивается нулями автоматически. Это стандарт, внезапно.
            Ответить
            • и правда)
              протупил

              Спасибо) Статическое объявление же

              зы: ну какой же хитрый парень, а?
              Ответить
              • > Статическое объявление же
                Любое. Если ты массив начал заполнять - то хвост всегда забьётся нулями. Даже на стеке.
                Ответить
                • я имел ввиду "на стеке". В том смысле что не через кучу.

                  Я не виноват что в сишечке слово "static" перегружено
                  Ответить
                  • Да даже через кучу:

                    new int[100] {0} создаст тебе массив из 100 нулей
                    Ответить
                    • иди отсюда со своими крестами

                      я про сишечку говорю

                      malloc (именно кошерный маллок а не один из тысячи его друзей) ничего не гобнулает
                      Ответить
                  • По драфту от стандарта C11. (N1570)

                    6.7.9.21
                    `If there are fewer initializers in a brace-enclosed list than there are elements or members
                    of an aggregate, or fewer characters in a string literal used to initialize an array of known
                    size than there are elements in the array, the remainder of the aggregate shall be
                    initialized implicitly the same as objects that have static storage duration.'


                    6.7.9.10
                    `
                    If an object that has automatic storage duration is not initialized explicitly, its value is
                    indeterminate. If an object that has static or thread storage duration is not initialized
                    explicitly, then:
                    — if it has pointer type, it is initialized to a null pointer;
                    — if it has arithmetic type, it is initialized to (positive or unsigned) zero;
                    — if it is an aggregate, every member is initialized (recursively) according to these rules,
                    and any padding is initialized to zero bits;
                    — if it is a union, the first named member is initialized (recursively) according to these
                    rules, and any padding is initialized to zero bits;
                    '
                    Ответить
          • он хотябы думает, в отличии от тебя, бароп
            Ответить
        • Виндовые хедеры дефайнят целую кучу разных булов:
          typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
          typedef WINBOOL BOOL;
          typedef BOOL *PBOOL,*LPBOOL;
          typedef BYTE BOOLEAN,*PBOOLEAN;

          Но все они заглавными буквами. А вот в <stdbool.h> действительно «маленький» бул имеется:
          #if defined __cplusplus
            /* Assume the compiler has 'bool' and '_Bool'.  */
          #else
          # define _Bool signed char
          #endif
          #define bool _Bool
          Ответить
        • да, это с 99.
          В c89 не было

          еще бул есть в Objc с cocoa.
          Там их штук пять разных
          Ответить

Добавить комментарий

Переведи на "PHP", guest!

    А не использовать ли нам bbcode?


    8