testprog.cpp
来自「这是学习《Data Structures Using C++》」· C++ 代码 · 共 36 行
CPP
36 行
//Test program: Polynomial Operations
#include <iostream>
#include "polynomialType.h"
using namespace std;
int main()
{
polynomialType p(8); //Line 1
polynomialType q(4); //Line 2
polynomialType t; //Line 3
cin>>p; //Line 4
cout<<endl<<"Line 5: p(x): "<<p
<<endl; //Line 5
cout<<"Line 6: p(5): "<<p(5)
<<endl<<endl; //Line 6
cin>>q; //Line 7
cout<<endl<<"Line 8: q(x): "<<q
<<endl<<endl; //Line 8
t = p + q; //Line 9
cout<<"Line 10: p(x) + q(x): "
<<t<<endl; //Line 10
cout<<"Line 11: p(x) - q(x): "
<<p - q<<endl; //Line 11
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?