- 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
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 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;
}
лаба 1, лаба 2, лаба 3
> system(pause);
ебать, такого я ещё не видел
простите мою необразованность
а там \null в конце не надо?
>> [6]
протупил
Спасибо) Статическое объявление же
зы: ну какой же хитрый парень, а?
Любое. Если ты массив начал заполнять - то хвост всегда забьётся нулями. Даже на стеке.
Я не виноват что в сишечке слово "static" перегружено
new int[100] {0} создаст тебе массив из 100 нулей
я про сишечку говорю
malloc (именно кошерный маллок а не один из тысячи его друзей) ничего не гобнулает
но ты-то!
напейсал же
"именно кошерный маллок а не один из тысячи его друзей) "
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;
'
Ещё вроде Win хедеры дефайнят бул.
Но все они заглавными буквами. А вот в <stdbool.h> действительно «маленький» бул имеется:
В c89 не было
еще бул есть в Objc с cocoa.
Там их штук пять разных