C++圆的周长和面积

//输入圆的半径,输出圆的周长和面积,用换行隔开,均保留6位小数

//π取3.14159

#include<bits/stdc++.h>

using namespace std;

int main()

{

    double r,s,c;

    cin>>r;

    s=3.14159*r*r;

    c=3.14159*r*2;

    printf("%.6lf\n%.6lf",c,s);

    return 0;

}

猜你喜欢

转载自blog.csdn.net/csdn_3011692917/article/details/79678379
今日推荐