AtCoder Beginner Contest 134 A
コード
#include<iostream> #include<cmath> using namespace std; int main() { int r; cin >> r; cout << 3 * pow(r, 2) << endl; }
学んだこと
- cmathというライブラリをincludeすると、べき乗計算のための
std::pow
関数が使える。
#include<iostream> #include<cmath> using namespace std; int main() { int r; cin >> r; cout << 3 * pow(r, 2) << endl; }
std::pow
関数が使える。