[表示 : 全て 最新50 1-99 101- 201- 301- 401- 501- 601- 701- 2chのread.cgiへ]
Update time : 08/07 07:52 / Filesize : 230 KB / Number-of Response : 708
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

C/C++の宿題を片付けます 96代目



185 名前:デフォルトの名無しさん [2007/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はおかしすぎる






[ 続きを読む ] / [ 携帯版 ]

全部読む 前100 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<230KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef