freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于vcmfc的科學(xué)計(jì)算器程序?qū)嶒?yàn)報(bào)告-在線瀏覽

2024-11-01 12:00本頁(yè)面
  

【正文】 += 1 。 } void CMyDlg::OnButton2() { // 數(shù)字 2 thischeck() 。 GetDlgItem( IDC_EDIT_SHOW )SetWindowText( num_buffer ) 。 num_buffer += 3 。 } void CMyDlg::OnButton4() { // 數(shù)字 4 thischeck() 。 GetDlgItem( IDC_EDIT_SHOW )SetWindowText( num_buffer ) 。 num_buffer += 5 。 } void CMyDlg::OnButton6() { // 數(shù)字 6 thischeck() 。 GetDlgItem( IDC_EDIT_SHOW )SetWindowText( num_buffer ) 。 num_buffer += 7 。 } void CMyDlg::OnButton8() { // 數(shù)字 8 thischeck() 。 GetDlgItem( IDC_EDIT_SHOW )SetWindowText( num_buffer ) 。 num_buffer += 9 。 } void CMyDlg::OnButtonDot() { // 小數(shù)點(diǎn) if ( () ) { num_buffer = 0. 。.39。 } GetDlgItem( IDC_EDIT_SHOW )SetWindowText( num_buffer ) 。 // 轉(zhuǎn)化為字符串 ( _T(%lf), m_num )。 } 運(yùn)行結(jié)果如下: ②加減乘除代碼的實(shí)現(xiàn): 通過(guò)控件的綁定以及傳值函數(shù),以指針調(diào)用的方式進(jìn)行賦值,并將結(jié)果保存在 num_buffer中,與下一次輸入的 num2 進(jìn)行新的一元運(yùn)算并給 result 賦值,通過(guò) Updatedata()函數(shù)反應(yīng)到文本編輯框中,具體代碼如下: //加 void CMyDlg::OnButtonAdd() { thisnum1 = atof( num_buffer ) 。 thisoperation_type = ADD 。 this() 。} // 乘 void CMyDlg::OnButtonMul() { thisnum1 = atof( num_buffer ) 。 thisoperation_type = MUL 。 this() 。 } void CMyDlg::OnButtonRes() { const double EPSINON = 。 thisnum2 = atof( num_buffer ) 。 switch( thisoperation_type ) { case ADD : thism_num = num1 + num2 。 case SUB : thism_num = num1 num2 。 case MUL : thism_num = num1 * num2 。 case DIV : if ( (num2 EPSINON ) amp。 (num2 = EPSINON) ){ num_buffer = 除數(shù)不能為零 。} else{ thism_num = num1 / num2 。 default:thism_num = thisnum2 。} 結(jié)果如下圖所示 ③科學(xué)性運(yùn)算按鈕的處理: 只需根據(jù)數(shù)值分析等為按鈕進(jìn)行算法的合理設(shè)計(jì),正確賦值即可,具體代碼如下: // 自然底數(shù) e void CScience::OnButtonEConst() { thischeck() 。 fresh() 。 (_T(%lf) , M_PI) 。 } void CScience::OnButtonNi() { // 正負(fù)處理 m_result = atof( num_buffer ) 。 fresh() 。 const double EPSINON = 。 if ( (thism_result = EPSINON) amp。 (thism_result = EPSINON) ) { GetDlgItem(IDC_EDIT_SHOW)SetWindowText(0 的倒數(shù)沒(méi)有定義 \n) 。 ( _T(%lf), m_result )。 thisunary_operation = false 。 CString tmp = num_buffer 。 (_T(%lf) , thism_result * 100 ) 。 fresh(tmp) 。 } void CScience::OnButtonSqr() { thisunary_operation = true 。 thism_result = sqrt(m_result) 。 fresh() 。 } void CScience::OnButtonSin() { CString tmp 。 thism_result = atof(num_buffer) 。 tmp = Sin( + num_buffer + ) = 。 (_T(%lf) , thism_result) 。 fresh(tmp) 。 } void CScience::OnButtonCos() { CString tmp 。 thism_result = atof(num_buffer) 。 tmp = Cos( + num_buffer + ) = 。 (_T(%lf) , thism_result) 。 fresh(tmp) 。 } void CScience::OnButtonTan() { CString tmp 。 thisunary_operation = true 。 (_T(%lf) , thism_result) 。 if ( (cos(m_r
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1