// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#include <time.h>
using namespace std;
int main()
{
//cout <<"你好";
//char gree[6]= {'H','e','L','L','o','\0'};
//直接输出;
/**cout <<gree <<endl;
//循环输出
for (int i = 0; i <sizeof(gree); i++)
{
cout <<gree[i]<<endl;
}*/
//指针
/*
int var=20;
int *ip;
ip=&var;
cout<<"Value of var variable:";
cout<<var<<endl;
cout<<"Address stored in ip variable:"<<endl;
cout<<ip<<endl;
cout<<"value of * ip variable:";
cout<<*ip<<endl;
*/
//引用
/*int i;
int& r=i;
double d ;
double& s=d;
i=10;
cout<<"value of i:"<<i<<endl;
cout<<"value of d reference :"<<r<<endl;
d=11.1;
cout<<"value of i:"<<d<<endl;
cout<<"value of d reference :"<<s<<endl; */
//死循环,只要I>0就行
for (int i = 1; i>0 ; i++)
{
//获取但前时间
SYSTEMTIME sys;
GetLocalTime( &sys );
printf( "%4d/%02d/%02d %02d:%02d:%02d.%03d 星期%1d \n",sys.wYear,sys.wMonth,sys.wDay,sys.wHour,sys.wMinute, sys.wSecond,sys.wMilliseconds,sys.wDayOfWeek);
//延迟一秒执行
Sleep(1000);
//清屏操作
system("Cls");
}
return 0;
}