想看題目請點我
#include <iostream>
#include <math.h>
#include <iomanip> //格式控制
using namespace std;
int main() {
unsigned int a , b , count;
while( cin >> a >> b )
{
cout << pow(a,b) << endl ; //a 的 b 次方
cin >> a ;
cout << fixed << setprecision(3) << sqrt(a) << endl ;
//平方根,小數點下3位
int c ;
cin >> c ;
if(c >= 0) //絕對值
cout << c << endl ;
else
cout << 0-c << endl ;
cin >> a >> b ;
cout << rand()%(b-a)+a << endl ;
}
return 0;
}