#include<iostream>
#include<cmath> //cmath標頭檔為特殊運算語法,沒有寫的話無法執行pow(,)平方運算語法
using namespace std;
int main()
{
double a,b;
cout<<"設a:";
cin>>a;
cout<<"設b:";
cin>>b;
cout<<"a的b平方="<<pow(a,b)<<endl;
system("pause");
return 0;
}
輸出結果:
設a:4
設b:2
a的b平方=16
請按任意鍵繼續 . . .
cmath標頭檔裡面語法可以進行較為複雜的運算語法。
全站熱搜
留言列表