第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

程序中的顏色和邊框的函數(shù)怎么來運(yùn)用?求大佬指點(diǎn)

程序中的顏色和邊框的函數(shù)怎么來運(yùn)用?求大佬指點(diǎn)

C
ibeautiful 2023-04-23 18:14:08
是編寫一個(gè)計(jì)算器不過是要復(fù)雜一點(diǎn)比如1.加法 2.減法 3.乘法 4.除法 5.退出輸入:-----如果輸入1.進(jìn)行加法2.進(jìn)行減法·····5.退出我是用中文說的當(dāng)然用那個(gè)C語言是用英文的還有就是把背景弄一下謝謝了
查看完整描述

2 回答

?
慕村9548890

TA貢獻(xiàn)1884條經(jīng)驗(yàn) 獲得超4個(gè)贊

f(c=='-') 

if(strcmp(str2,"")==0) /*如果str2為空,說明是負(fù)號,而不是減號*/ 
flag=-1; /*設(shè)置負(fù)數(shù)標(biāo)志*/ 
else 

num1=atof(str2); /*將第二個(gè)操作數(shù)轉(zhuǎn)換為浮點(diǎn)數(shù)*/ 
strcpy(str2,""); /*將str2清空*/ 
act=2; /*做計(jì)算減法標(biāo)志值*/ 
setfillstyle(SOLID_FILL,color+3); 
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*畫矩形*/ 
outtextxy(5*width,height,"0."); /*顯示字符串*/ 


if(c=='*') 

num1=atof(str2); /*將第二個(gè)操作數(shù)轉(zhuǎn)換為浮點(diǎn)數(shù)*/ 
strcpy(str2,""); /*將str2清空*/ 
act=3; /*做計(jì)算乘法標(biāo)志值*/ 
setfillstyle(SOLID_FILL,color+3); bar(2*width+width/2,height/2,15*width/2,3*height/2); 
outtextxy(5*width,height,"0."); /*顯示字符串*/ 

if(c=='/') 

num1=atof(str2); /*將第二個(gè)操作數(shù)轉(zhuǎn)換為浮點(diǎn)數(shù)*/ 
strcpy(str2,""); /*將str2清空*/ 
act=4; /*做計(jì)算除法標(biāo)志值*/ 
setfillstyle(SOLID_FILL,color+3); 
bar(2*width+width/2,height/2,15*width/2,3*height/2); 
outtextxy(5*width,height,"0."); /*顯示字符串*/ 

if(c=='^') 

num1=atof(str2); /*將第二個(gè)操作數(shù)轉(zhuǎn)換為浮點(diǎn)數(shù)*/ 
strcpy(str2,""); /*將str2清空*/ 
act=5; /*做計(jì)算乘方標(biāo)志值*/ 
setfillstyle(SOLID_FILL,color+3); /*設(shè)置用淡綠色實(shí)體填充*/ 
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*畫矩形*/ 
outtextxy(5*width,height,"0."); /*顯示字符串*/ 

if(c=='%') 

num1=atof(str2); /*將第二個(gè)操作數(shù)轉(zhuǎn)換為浮點(diǎn)數(shù)*/ 
strcpy(str2,""); /*將str2清空*/ 
act=6; /*做計(jì)算模運(yùn)算乘方標(biāo)志值*/ 
setfillstyle(SOLID_FILL,color+3); /*設(shè)置用淡綠色實(shí)體填充*/ 
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*畫矩形*/ 
outtextxy(5*width,height,"0."); /*顯示字符串*/ 

if(c=='=') 

num2=atof(str2); /*將第二個(gè)操作數(shù)轉(zhuǎn)換為浮點(diǎn)數(shù)*/ 
switch(act) /*根據(jù)運(yùn)算符號計(jì)算*/ 

case 1:result=num1+num2;break; /*做加法*/ 
case 2:result=num1-num2;break; /*做減法*/ 
case 3:result=num1*num2;break; /*做乘法*/ 
case 4:result=num1/num2;break; /*做除法*/ 
case 5:result=pow(num1,num2);break; /*做x的y次方*/ 
case 6:result=fmod(num1,num2);break; /*做模運(yùn)算*/ 

setfillstyle(SOLID_FILL,color+3); /*設(shè)置用淡綠色實(shí)體填充*/ 
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*覆蓋結(jié)果區(qū)*/ 
sprintf(temp,"%f",result); /*將結(jié)果保存到temp中*/ 
outtextxy(5*width,height,temp); /*顯示結(jié)果*/ 

if(c=='c') 

num1=0; /*將兩個(gè)操作數(shù)復(fù)位0,符號標(biāo)志為1*/ 
num2=0; 
flag=1; 
strcpy(str2,""); /*將str2清空*/ 
setfillstyle(SOLID_FILL,color+3); /*設(shè)置用淡綠色實(shí)體填充*/ 
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*覆蓋結(jié)果區(qū)*/ 
outtextxy(5*width,height,"0."); /*顯示字符串*/ 

if(c=='Q')exit(0); /*如果選擇了q回車,結(jié)束計(jì)算程序*/ 

putimage(x,y,rar,XOR_PUT); /*在退出之前消去光標(biāo)箭頭*/ 
return; /*返回*/ 

/*窗口函數(shù)*/ 
void mwindow( char *header ) 

int height; 
cleardevice(); /* 清除圖形屏幕 */ 
setcolor( MaxColors - 1 ); /* 設(shè)置當(dāng)前顏色為白色*/ 
setviewport( 20, 20, MaxX/2, MaxY/2, 1 ); /* 設(shè)置視口大小 */ 
height = textheight( "H" ); /* 讀取基本文本大小 */ 
settextstyle( DEFAULT_FONT, HORIZ_DIR, 1 );/*設(shè)置文本樣式*/ 
settextjustify( CENTER_TEXT, TOP_TEXT );/*設(shè)置字符排列方式*/ 
outtextxy( MaxX/4, 2, header ); /*輸出標(biāo)題*/ 
setviewport( 20,20+height+4, MaxX/2+4, MaxY/2+20, 1 ); /*設(shè)置視口大小*/ 
drawboder(); /*畫邊框*/ 

void drawboder(void) /*畫邊框*/ 

struct viewporttype vp; /*定義視口類型變量*/ 
setcolor( MaxColors - 1 ); /*設(shè)置當(dāng)前顏色為白色 */ 
setlinestyle( SOLID_LINE, 0, NORM_WIDTH );/*設(shè)置畫線方式*/ 
getviewsettings( &vp );/*將當(dāng)前視口信息裝入vp所指的結(jié)構(gòu)中*/ 
rectangle( 0, 0, vp.right-vp.left, vp.bottom-vp.top ); /*畫矩形邊框*/ 

/*設(shè)計(jì)鼠標(biāo)圖形函數(shù)*/ 
int arrow() 

int size; 
int raw[]={4,4,4,8,6,8,14,16,16,16,8,6,8,4,4,4}; /*定義多邊形坐標(biāo)*/ 
setfillstyle(SOLID_FILL,2); /*設(shè)置填充模式*/ 
fillpoly(8,raw); /*畫出一光標(biāo)箭頭*/ 
size=imagesize(4,4,16,16); /*測試圖象大小*/ 
rar=malloc(size); /*分配內(nèi)存區(qū)域*/ 
getimage(4,4,16,16,rar); /*存放光標(biāo)箭頭圖象*/ 
putimage(4,4,rar,XOR_PUT); /*消去光標(biāo)箭頭圖象*/ 
return 0; 

/*按鍵函數(shù)*/ 
int specialkey(void) 

int key; 
while(bioskey(1)==0); /*等待鍵盤輸入*/ 
key=bioskey(0); /*鍵盤輸入*/ 
key=key&0xff? key&0xff:key>>8; /*只取特殊鍵的掃描值,其余為0*/ 
return(key); /*返回鍵值*/ 
}


查看完整回答
反對 回復(fù) 2023-04-26
?
阿晨1998

TA貢獻(xiàn)2037條經(jīng)驗(yàn) 獲得超6個(gè)贊

純C語言,沒有圖形界面的,要做出圖形界面,得依靠系統(tǒng)的API,如MFC、WIN32 API、QT、等

查看完整回答
反對 回復(fù) 2023-04-26
  • 2 回答
  • 0 關(guān)注
  • 209 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號