1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <stdio.h> #define PI 3.14 int main() { float r ,s , l; printf("please input r:\n"); scanf("%f",&r); if (r>=0) {s=PI*r*r; l=2*PI*r ; printf("the area is %f\n",s); printf("the circumference is %f\n",l);} else printf("input error!\n"); }
1 2 3 4
please input r: input error! Exited: ExitFailure 13