實(shí)驗(yàn)實(shí)驗(yàn)內(nèi)容和實(shí)驗(yàn)要求_第1頁
實(shí)驗(yàn)實(shí)驗(yàn)內(nèi)容和實(shí)驗(yàn)要求_第2頁
實(shí)驗(yàn)實(shí)驗(yàn)內(nèi)容和實(shí)驗(yàn)要求_第3頁
實(shí)驗(yàn)實(shí)驗(yàn)內(nèi)容和實(shí)驗(yàn)要求_第4頁
實(shí)驗(yàn)實(shí)驗(yàn)內(nèi)容和實(shí)驗(yàn)要求_第5頁
已閱讀5頁,還剩5頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

P148P154①將程序中的“s=1.0/2*(a+b+c;”語句改為“s=1/2*(a+b+c);”,再進(jìn)行編譯、、c));ify==2.2)”改為“iffabs(y-2.2)<1e-6)”,然后運(yùn)行程序,查看結(jié)果,#include<iostream>#include<cmath>usingnamespacestd;intmain(){floatx,y;if(fabs(y-2.2)<1e-cout<<"x==y"<<endl;if(x=y)cout這是一個(gè)邏輯錯(cuò)誤!endl;return0;}if(x=y)”到底要表達(dá)何意?請(qǐng)改成正確的形式。修改后的程序#include<iostream>#include<cmath>usingnamespacestd;intmain(){floatx,y;if(fabs(y-2.2)<1e-6)cout<<"x==y"<<endl;if(x==y)coutendl;return0;}#include<iostream>#include<cmath>usingnamespacestd;intmain(){floatcin>>a>>b>>c;if(fabs(a)<1e-6)cout<<"isnotquadratic"<<{if(fabs(d)<=1e- {cout<<"hastwoequalroots:\n";cout<<"x1=x2="<<x1<<}elseif(d>1e- {x1=(-cout<<"hastworealroots:\n"cout<<"x1="<<x1<<",x2="<<x2<<} {cout<<"hastwocomplexroots:cout<<"x1="<<lp<<"+"<<ip<<"i\n";cout<<"x2="<<lp<<"-"<<ip<<}}return}1位小數(shù)。#include<iostream>#include<cmath>#include<iomanip>usingnamespacestd;int{floatcin>>a>>b>>c;cout<<setprecision(1);if(fabs(a)<1e-cout<<"isnotquadratic"<<{iffabs(d)<=1e- //{cout<<"hastwoequalroots:\n";cout<<"x1=x2="<<x1<<}elseif(d>1e- //{x1=(-cout<<"hastworealroots:\n"cout<<"x1="<<x1<<",x2="<<x2<<} //{cout<<"hastwocomplexroots:cout<<"x1="<<lp<<"+"<<ip<<"i\n";cout<<"x2="<<lp<<"-"<<ip<<"i\n";}}return}switchdefaultdefaultcasebreak正確嗎?請(qǐng)解釋。caseswitch語句,有沒有40,000s,編寫程序,將其轉(zhuǎn)換成幾小時(shí)幾分#include<iostream>usingnamespacestd;intmain(){inta=40000,b,c;a=(a-cout<<"40000秒是"<<a<<"小時(shí)"<<c<<"分鐘"<<b<<"秒";return0;}#include<iostream>usingnamespacestd;intmain(){intif((a+b)>c&&(a+c)>b&&(b+c)>a{if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a)elseif(a==b&&elseif(a==b||a==c||b==c)}return0;}}rh(#include<iostream>usingnamespacestd;intmain(){ return}24688642。#include<iostream>usingnamespacestd;intmain(){int elseif(c==00&&d==0&&e==0&&f==0)elseif(d==0&&e==0&&f==0)elseif(e==0&&f==0)elseif(f==0){case(2):cout<<a<<""<<b;break;case(3):cout<<a<<""<<b<<""<<c;break;case(4):cout<<a<<""<<b<<""<<c<<""<<d;break;case(5):cout<<a<<""<<b<<""<<c<<""<<d<<""<<e;break;case(6):cout<<a<<""<<b<<""<<c<<""<<d<<""<<e<<""<<f;break;}return0;}4a成為最大值,d4個(gè)數(shù)。#include<iostream>usingnamespacestd;intmain(){inta,b,c,d,k,l,i,j;intm

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論