关键字:数据结构,链表,一元多项式

代码清单:

  1. main.cpp
  2. Elem.h
  3. Elem.cpp
  4. List.h
  5. List.cpp
  6. Polyn.h
  7. Polyn.cpp

Windows7 64位下 Code::Blocks12.11 GCC 编译运行通过。

原文地址:http://www.cnblogs.com/fengzy/archive/2013/06/01/3113039.html

欢迎交流学习,转载请注明出处。如有问题,请留言。

下面是源代码。

  1. main.cpp
     1 //----- main.cpp ------
     2 #include <iostream>
     3 #include <cassert>
     4 #include <stdlib.h>
     5 #include "Polyn.h"
     6 
     7 using namespace std;
     8 
     9 #define PRINT(x) cout << #x << " = " << (x)
    10 #define READ(x) cout << #x << "'s SIZE: "; (x).read()
    11 
    12 int main()
    13 {
    14     Polyn Pa, Pb;
    15 
    16     READ(Pa);
    17     READ(Pb);
    18 
    19     system("cls");
    20 
    21     PRINT(Pa);
    22     PRINT(Pb);
    23 
    24     PRINT(Pa + Pb);
    25     PRINT(Pa - Pb);
    26     PRINT(Pb - Pa);
    27     PRINT(Pa * Pb);
    28 
    29     return 0;
    30 }
    View Code

相关文章:

  • 2021-05-06
  • 2022-12-23
  • 2021-07-01
  • 2021-07-24
  • 2021-10-19
  • 2022-12-23
  • 2021-05-26
猜你喜欢
  • 2021-08-23
  • 2021-12-17
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
  • 2021-06-20
  • 2021-08-07
相关资源
相似解决方案