用C++计算圆的周长和面积
1 #include <stdio.h> 2 void main() 3 { 4 float r; 5 double cir,area; 6 const double pi=3.1415926; 7 printf ("please enter a numbers as radius:"); 8 scanf ("%f",&r); 9 cir=2.0*pi*r; 10 area=pi*r*r; 11 printf ("the circumference is: %f\n",cir); 12 printf ("the area is: %f\n",area); 13 }