usetime.cpp
来自「我学习C++ Primer Plus过程中写下的课后作业的编程代码」· C++ 代码 · 共 22 行
CPP
22 行
// usetime.cpp -- using the fourth draft of the Time class
// comile usetime.cpp and mytime.cpp together
#include <iostream>
#include "mytime.h"
int main()
{
using std::cout;
using std::endl;
Time aida(3,35);
Time tosca(2,48);
Time temp;
cout<<"Aida and Tosca:\n";
cout<<aida<<"; "<<tosca<<endl;
temp = aida + tosca; // operator+()
cout<<"Aida + Tosca: "<<temp<<endl;
temp = aida * 1.17; // member operator * ()
cout<<"Aida * 1.17: "<<temp<<endl;
cout<<"10 * Tosca: "<<10 * tosca<<endl;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?