回文章列表
作者easterday@bbs.ee.ntu.edu.tw (數牙), 信區: medeng
標題ct003.cpp
時間台大電機 Maxwell BBS (Sun Aug 29 20:51:21 1999)
轉信站: GIBBS!news.mc.ntu!Maxwell

//  我在DOS下寫的,所以註解只能用鱉腳的台灣英文
//
#include <iostream.h>
#include "antct.h"
#include <conio.h>
//const Maxx_elem=10;
main(void)
{
/* I'm considering the matrix like      1 2 0
                                        0 0 0
                                        0 0 0

*/
 int v[]={1,2,0};
 int h[]={3,0,0};
 int q[]={0,2,1,0,0};
 int k=sizeof(int);
 cout<<"\n\number of v="<<int (sizeof(v)/sizeof(int))<<"\n";
 cout<<"v={";
        for (int n1=0; n1<sizeof(v)/sizeof(int); n1++)
        {cout<<v[n1]<<",";}
 cout<<"}\n";
 cout<<"h={";
        for (int n2=0; n2<sizeof(h)/sizeof(int); n2++)
        {cout<<h[n2]<<",";}
                cout<<"}\n";
 cout<<"q={";
 for (int n3=0; n3<sizeof(q)/sizeof(int); n3++)
        {cout<<q[n3]<<",";}
                cout<<"}\n";



 ANTCT p1( v,sizeof(v)/k,
           h,sizeof(h)/k,
           q,sizeof(q)/k );
// 1. check whether object is fine;
 if (p1.init()==0)
        cout<<"Object is Fine!\n";
 else
     {  cout<<"Object is Wrong!\n";
        return 0;

     }
// 2. size
        cout<<"object p1 size="<<p1.size()<<"\n";
// 3. print
        p1.print();
// 4.
for (int r=0; r<100; r++)
{
        p1.h_step();
        p1.print();

        p1.q_step();
        p1.print();

        p1.v_step();
        p1.print();
        getch();
}
p1.fp();


return 0;
}
--
※ Origin: 臺大電機 Maxwell 站 ◆ From: h120.s155.ts32.hinet.net
文章選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻