ConsoleApplication16 cpp Defines the entry point for the console appli

 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
// ConsoleApplication16.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <locale.h>
#include <time.h>
#include <Windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
FLOAT Start, End, TimeProg;
Start = GetTickCount();
setlocale(LC_ALL, "RUSSIAN");
DWORD nIn;
TCHAR buf[16],buf2[]=_T("Сокращенное название текущего месяца: ");
CHAR buf3[32];
time_t t = time(NULL);
tm* local = localtime(&t);
_tcsftime(buf, 16,_T("%b"), local);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_GREEN | FOREGROUND_BLUE);
WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE),buf2,_tcslen(buf2),&nIn,NULL);
WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE),buf,_tcslen(buf),&nIn,NULL);
End = GetTickCount();
TimeProg = (End - Start) / 1000;
wprintf(L"\nВремя работы программы: %.3f\n",TimeProg);
getchar();
return 0;
}