C/C++の宿題を片付け ..
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
183:デフォルトの名無しさん 07/09/24 14:59:18 2:char*pastr; 8:free(pastr); 184:デフォルトの名無しさん 07/09/24 15:00:00 2:char*patr; 8:free(patr); 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はおかしすぎる
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
5296日前に更新/230 KB
担当:undef