C/C++の宿題を片付け ..
[2ch|▼Menu]
185:デフォルトの名無しさん
07/09/24 15:04:33
>>163
#include <iostream>
#include <cstdio>
#include <cmath>

int main()
{
using std::cin;
using std::printf;
using std::putchar;
char *str[4] = {"Enter the base: ",
"Enter the exponent: ",
"%d to the %d power equals %.0lf.",
"The square root of %d equals %1.2lf"};
int b,ex;
double p,r;
printf(str[0]);
cin >> b;
printf(str[1]);
cin >> ex;
printf(str[2],b,ex,pow(static_cast<double>(b),ex));
putchar('\n');
printf(str[3],b,sqrt(static_cast<double>(b)));
putchar('\n');

return 0;
}
The square root of 3 equals 1.41はおかしすぎる


次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5282日前に更新/230 KB
担当:undef