描述
给定一个整数r代表一个圆的半径。
你的任务是返回一个数组。
其中数组的第一个元素代表圆的周长,数组的第二个元素代表圆的面积。
PI = 3.14
样例 1:
输入 : r = 2
输出 : [12.56, 12.56]
class Solution {
public:
/**
* @param r: a Integer represent radius
* @return: the circle's circumference nums[0] and area nums[1]
*/
vector<double> calculate(int r) {
// write your code here
vector<double>ans;
ans.push_back(2*3.14*r);
ans.push_back(3.14*r*r);
return ans;
}
};