⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpp01.cpp

📁 C++参考书
💻 CPP
字号:

// Coded by plusir -- Jan.14.2003.
// Standard C++ Bible -- (P757-28-1)

#include <iostream>
#include <locale>
#include <ctime>
using namespace std ;

int main()
{
	char dateStr[81] ;
	time_t curTime ;
	tm *tmTime ;
	curTime = time( NULL ) ;
	tmTime = gmtime( &curTime ) ;

	strftime( dateStr, 80, "%#x", tmTime ) ;
	locale native( "" ) ;
	locale::global( native ) ;
	cout << "Native Date: " << endl ;
	cout << dateStr << endl << endl ;

	locale french( "french" ) ;
	locale::global( french ) ;
	strftime( dateStr, 80, "%#x", tmTime ) ;
	cout << "French Date: " << endl ;
	cout << dateStr << endl << endl ;

	locale german( "german" ) ;
	locale::global( german ) ;
	strftime( dateStr, 80, "%#x", tmTime ) ;
	cout << "German Date:" << endl ;
	cout << dateStr << endl << endl ;

	locale chinese( "chs" ) ;
	locale::global( chinese ) ;
	strftime( dateStr, 80, "%#x", tmTime ) ;
	cout << "chinese Date:" << endl ;
	cout << dateStr << endl << endl ;

	return 0 ;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -