📄 pr15003.cpp
字号:
////////////////////////////////////////
// File Name: pr15003.cpp
////////////////////////////////////////
#include <iostream>
#include <iomanip>
#include <Date.h>
#include "Barray.h"
int main()
{
// A bounded array of dates.
Array<Date, 5> dateArray;
// Some dates.
Date dt1(12,17,37);
Date dt2(11,30,38);
Date dt3(6,24,40);
Date dt4(10,31,42);
Date dt5(8,5,44);
// Put the dates in the array.
dateArray[0] = dt1;
dateArray[1] = dt2;
dateArray[2] = dt3;
dateArray[3] = dt4;
dateArray[4] = dt5;
// Display the dates.
for (int i = 0; i < 5; i++)
std::cout << dateArray[i] << std::endl;
std::cout << std::flush;
// Try to put a date in the array
// outside the range of the subscript.
Date dt6(1,29,92);
dateArray[5] = dt6; // Template's assertion aborts.
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -