📄 show.cpp
字号:
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
#include <string.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
#include "Stock.h"
#include "GuestStock.h"
#include "Guest.h"
#include "Show.h"
#include "#Define.h"
void ShowAllStock(Stock stockObj[])
{
cout<<"上证股市\t\t\t";
time_t now;
time ( &now );
tm *today = localtime (&now );
cout<<1900+today->tm_year<<' '<<setfill('0')<<setw(2)<<1+today->tm_mon<<' '
<<setw(2)<<today->tm_mday<<' '<<setw(2)<<today->tm_hour<<':'
<<setw(2)<<today->tm_min<<':'<<setw(2)<<today->tm_sec<<setfill(' ')<<endl;
cout<<endl;
ShowStockTable();
for (int i=0; i<STOCKNUM; i++)
{
cout<<stockObj[i];
}
cout<<endl;
}
void ShowStockTable()
{
cout<<setw(9)<<"股票代码"
<<setw(9)<<"股票名称"
<<setw(8)<<"开盘价"
<<setw(8)<<"当前价"
<<setw(8)<<"发行量"
<<setw(9)<<"涨跌幅%" //char *rank
//out<<setw(5)<<stkObj1.stkRange<<"%"<<"\t"; //int rank
<<setw(6)<<"排名"<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -