cpp14.cpp

来自「C++参考书」· C++ 代码 · 共 36 行

CPP
36 行
字号

// Coded by plusir -- Dec.27.2002.
// Standard C++ Bible -- (P131-5-14)

#include <iostream>
using namespace std ;

struct Date
{
	int month ;
	int day ;
	int year ;
} ;

struct Employee
{
	int emplno ;
	double salary ;
	Date datehired ;
} ;

int main()
{
	Employee joe = { 123, 35500, { 5, 17, 82 } } ;

	cout 
		<< "Empl #: " << joe.emplno << endl
		<< "Salary: " << joe.salary << endl
		<< "Date hired: "
		<< joe.datehired.month << '/'
		<< joe.datehired.day << '/'
		<< joe.datehired.year << endl ;
    
	return 0 ;
}

⌨️ 快捷键说明

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