| 5 | 1/1 | 返回列表 |
| 查看: 2356 | 回復(fù): 8 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
Zonkie銀蟲 (小有名氣)
|
[交流]
為什么這個(gè)程序運(yùn)行時(shí)有延遲,在VC++6.0中,就是點(diǎn)運(yùn)行要過一會(huì)兒才提示輸入 已有6人參與
|
||
|
#include using namespace std; double power(const double,const int); double power(const double x,const int n) { double y=1.0; for(int i=0;i y*=x; for(int j=0;j>n;j--) //if n<0,y=1.0/(x*x*.....*x) y/=x; return y; } int main() { int x,n; cout<<"請(qǐng)輸入底數(shù)x:";cin>>x; cout<<"請(qǐng)輸入指數(shù)n:";cin>>n; cout<<"power(x,n)="<<"power("< |
木蟲 (正式寫手)
木蟲 (知名作家)

金蟲 (著名寫手)
木蟲 (著名寫手)

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|