数据结构课程设计报告一元多项式计算 联系客服

发布时间 : 星期四 文章数据结构课程设计报告一元多项式计算更新完毕开始阅读529efe641ed9ad51f01df2ae

print(ha);

gotoTextPos(2,10); printf(\

gotoTextPos(2,10);

printf(\请输入多项式hb的系数与指数:\\n\hb=create();

gotoTextPos(2,17); print(hb);

gotoTextPos(2,18); printf(\

gotoTextPos(2,18);

printf(\多项式的和是:\\n\polyadd(ha,hb); gotoTextPos(2,19); print(ha);

gotoTextPos(2,19); printf(\

gotoTextPos(2,20);

printf(\请输入多项式hc的系数与指数:\\n\hc=create();

gotoTextPos(2,27); print(hc);

gotoTextPos(2,27); printf(\

gotoTextPos(2,28);

printf(\请输入多项式hd的系数与指数:\\n\hd=create();

gotoTextPos(2,35); print(hd);

gotoTextPos(2,35); printf(\

gotoTextPos(2,36);

printf(\多项式的差是:\\n\polycha(hc,hd); gotoTextPos(2,37); print(hc);

gotoTextPos(2,38); printf(\getch(); menu(); }

void menu() //主界面 {

20

kuanjia1();

gotoTextPos(16,8); printf(\ gotoTextPos(16,10); printf(\ gotoTextPos(2,14);

printf(\ int n;

scanf(\ switch(n) {

case 1:zlbds();break; case 2:return ;

default:gotoTextPos(28,14);printf(\

gotoTextPos(2,16);printf(\again!\

getch(); menu(); } }

int main() {

system(\

setConsoleTitle(\一元多项式计算 by余海刚\ system(\ menu(); kuanjia1();

gotoTextPos(10,7); printf(\拜\ delayMS(600);

gotoTextPos(19,7); printf(\拜\ delayMS(600);

gotoTextPos(20,9); printf(\ delayMS(600);

gotoTextPos(21,9); printf(\ delayMS(600);

gotoTextPos(24,9); printf(\余\ delayMS(600);

21

gotoTextPos(26,9); printf(\海\ delayMS(600);

gotoTextPos(28,9); printf(\刚\ delayMS(600); return 0; }

#include \

void delayMS(uint32 d) {

Sleep(d); return ; }

void clearText(void) {

system(\return ; }

int setTextColor(uint8 fColor) {

HANDLE hd = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbInfo;

GetConsoleScreenBufferInfo(hd, &csbInfo); return SetConsoleTextAttribute(hd, fColor | (csbInfo.wAttributes&~0x0F));

}

PCCOLOR getTextColor(void) {

CONSOLE_SCREEN_BUFFER_INFO csbInfo;

GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbInfo);

return (PCCOLOR)(csbInfo.wAttributes&0x0F); }

int setBackColor(uint8 bColor) {

HANDLE hd = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbInfo;

GetConsoleScreenBufferInfo(hd, &csbInfo);

22

return SetConsoleTextAttribute(hd, (bColor << 4) | (csbInfo.wAttributes&~0xF0));

}

PCCOLOR getBackColor(void) {

CONSOLE_SCREEN_BUFFER_INFO csbInfo;

GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbInfo);

return (PCCOLOR)((csbInfo.wAttributes&0xF0) >> 4); }

int setColors(uint8 fColor, uint8 bColor) {

HANDLE hd = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbInfo;

GetConsoleScreenBufferInfo(hd, &csbInfo);

return SetConsoleTextAttribute(hd, fColor | (bColor << 4) | (csbInfo.wAttributes&~0xFF));

}

int setSwapColors(bool b) {

HANDLE hd = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbInfo;

GetConsoleScreenBufferInfo(hd, &csbInfo); if (!!b)

return SetConsoleTextAttribute(hd, csbInfo.wAttributes | 0x4000); else

return SetConsoleTextAttribute(hd, csbInfo.wAttributes & ~0x4000); }

int setUnderLine(bool b) {

HANDLE hd = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbInfo;

GetConsoleScreenBufferInfo(hd, &csbInfo); if (!!b)

return SetConsoleTextAttribute(hd, csbInfo.wAttributes | 0x8000); else

return SetConsoleTextAttribute(hd, csbInfo.wAttributes & ~0x8000); }

uint8 getLineWidth(void)

23