- 001
- 002
- 003
- 004
- 005
- 006
- 007
- 008
- 009
- 010
- 011
- 012
- 013
- 014
- 015
- 016
- 017
- 018
- 019
- 020
- 021
- 022
- 023
- 024
- 025
- 026
- 027
- 028
- 029
- 030
- 031
- 032
- 033
- 034
- 035
- 036
- 037
- 038
- 039
- 040
- 041
- 042
- 043
- 044
- 045
- 046
- 047
- 048
- 049
- 050
- 051
- 052
- 053
- 054
- 055
- 056
- 057
- 058
- 059
- 060
- 061
- 062
- 063
- 064
- 065
- 066
- 067
- 068
- 069
- 070
- 071
- 072
- 073
- 074
- 075
- 076
- 077
- 078
- 079
- 080
- 081
- 082
- 083
- 084
- 085
- 086
- 087
- 088
- 089
- 090
- 091
- 092
- 093
- 094
- 095
- 096
- 097
- 098
- 099
- 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;
}
huesto 12.09.2016 19:15 # +4
лаба 1, лаба 2, лаба 3
Govnocoder_123456789 14.09.2016 16:27 # −4
huesto 12.09.2016 19:24 # +9
> system(pause);
ебать, такого я ещё не видел
bormand 12.09.2016 19:25 # +3
guestinho 12.09.2016 20:43 # +6
barop 14.09.2016 16:58 # −64
простите мою необразованность
а там \null в конце не надо?
roman-kashitsyn 14.09.2016 17:07 # +4
>> [6]
barop 14.09.2016 17:13 # −63
dxd 14.09.2016 17:17 # +2
barop 14.09.2016 17:17 # −63
протупил
Спасибо) Статическое объявление же
зы: ну какой же хитрый парень, а?
bormand 14.09.2016 18:01 # +2
Любое. Если ты массив начал заполнять - то хвост всегда забьётся нулями. Даже на стеке.
guestinho 14.09.2016 18:14 # +5
bormand 14.09.2016 18:17 # 0
inkanus-gray 14.09.2016 19:03 # +4
dxd 14.09.2016 19:16 # +8
inkanus-gray 14.09.2016 19:36 # +2
dxd 14.09.2016 21:36 # +2
HAPKOMAH 14.09.2016 22:41 # 0
huesto 14.09.2016 19:10 # +2
kipar 15.09.2016 12:41 # +1
barop 14.09.2016 22:28 # −64
Я не виноват что в сишечке слово "static" перегружено
Soul_re@ver 14.09.2016 22:35 # 0
new int[100] {0} создаст тебе массив из 100 нулей
barop 14.09.2016 22:42 # −64
я про сишечку говорю
malloc (именно кошерный маллок а не один из тысячи его друзей) ничего не гобнулает
HAPKOMAH 14.09.2016 22:43 # 0
guestinho 14.09.2016 23:09 # +1
BEPXOBHAR_PA9A 14.09.2016 23:21 # 0
1024-- 15.09.2016 18:01 # 0
Elvenfighter 14.09.2016 23:33 # 0
barop 14.09.2016 23:34 # −64
но ты-то!
напейсал же
"именно кошерный маллок а не один из тысячи его друзей) "
dxd 15.09.2016 08:19 # +3
BagorCtretora 15.09.2016 13:43 # −64
dxd 15.09.2016 15:29 # 0
Elvenfighter 14.09.2016 23:34 # 0
dxd 15.09.2016 08:23 # +1
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;
'
XEP 14.09.2016 18:26 # +2
1024-- 15.09.2016 18:02 # +1
guest0 15.09.2016 21:05 # −63
Steve_Brown 16.09.2016 12:27 # 0
XEP 14.09.2016 18:27 # +3
BagorCtretora 15.09.2016 03:10 # −64
XEP 14.09.2016 18:26 # +3
guestinho 12.09.2016 20:54 # 0
Govnocoder_123456789 23.09.2016 13:13 # 0
Soul_re@ver 23.09.2016 13:38 # +1
Ещё вроде Win хедеры дефайнят бул.
inkanus-gray 23.09.2016 13:50 # +2
Но все они заглавными буквами. А вот в <stdbool.h> действительно «маленький» бул имеется:
barop 23.09.2016 21:47 # 0
В c89 не было
еще бул есть в Objc с cocoa.
Там их штук пять разных
guest 23.09.2016 21:56 # 0
barop 23.09.2016 21:59 # 0
barop 23.09.2016 21:46 # 0