標題:
pow函式運用
[打印本頁]
作者:
歐柏罕
時間:
2017-11-28 19:14
標題:
pow函式運用
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main()
{
double num,num2;
cout <<"請輸入數字"<<endl;
cin >> num;
cout <<"請輸入數字"<<endl;
cin >> num2;
cout << num << "的" << num2 << "次方為: " << pow(num,num2) << endl;
system("pause");
return 0;
}
複製代碼
作者:
巫沛庭
時間:
2017-11-28 19:18
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main()
{
double num,num1;
cout<<"請輸入數字:";
cin>>num;
cout<<"請輸入數字:";
cin>>num1;
cout<<num<<"的"<<num1<<"次方:"<<pow(num,num1)<<endl;
system("pause");
return 0;
}
作者:
巫晉宇
時間:
2017-11-28 19:19
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main()
{
double a,s;
cout<<"數字"<<endl;
cin>>a;
cout<<"數字"<<endl;
cin>>s;
cout<<a<<"的"<<s<<"次方為"<<pow(a,s)<<endl;
system("pause");
return 0;
}
作者:
張凱婷
時間:
2017-11-28 19:20
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main()
{
cout<<"@算次方@"<<endl;
double a,b;
cout<<"輸數字:"<<endl;
cin>>a;
cout<<"輸數字:"<<endl;
cin>>b;
cout<<a<<"的"<<b<<"次方為:"<<pow(a,b)<<endl;
system("pause");
return 0;
}
複製代碼
作者:
張閎鈞
時間:
2017-11-28 19:29
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main()
{
double num,num2;
cout <<"輸數"<<endl;
cin >> num;
cout <<"輸字"<<endl;
cin >> num2;
cout << num << "的" << num2 << "次方為: " << pow(num,num2) << endl;
system("pause");
return 0;
}
複製代碼
作者:
顏羽彤
時間:
2017-12-2 11:44
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main()
{
double num1,num2;
cout <<"請輸入底數:"<<endl;
cin >> num1;
cout <<"請輸入指數:"<<endl;
cin >> num2;
cout << num1 << "的" << num2 << "次方為: " << pow(num1,num2) << endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2