C/C++の宿題を片付けます 96代目at TECH
C/C++の宿題を片付けます 96代目 - 暇つぶし2ch185:デフォルトの名無しさん
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はおかしすぎる


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch