回答編集履歴

2

d

2019/08/15 10:57

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -4,7 +4,9 @@
4
4
 
5
5
 
6
6
 
7
+ ```python
8
+
7
- ```python#include <cmath>
9
+ #include <cmath>
8
10
 
9
11
  #include <iostream>
10
12
 

1

d

2019/08/15 10:56

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -1,12 +1,6 @@
1
- pow 関数の使い方は
1
+ pow 関数の使い方は `a^b` を計算する場合、 `pow(a, b)` とします。
2
2
 
3
-
4
-
5
- `pow(a*i)` ではなく、`pow(a, i)` です。
6
-
7
-
8
-
9
- `a^b` は `pow(a, b)`
3
+ 底と冪指数の引数2つが必要です。
10
4
 
11
5
 
12
6
 
@@ -20,9 +14,9 @@
20
14
 
21
15
  {
22
16
 
23
- // pow(2^3) ではない。
17
+ // 2^3 を計算
24
18
 
25
- std::cout << std::pow(2, 3) << std::endl;
19
+ std::cout << std::pow(2, 3) << std::endl; // 8
26
20
 
27
21
  }
28
22