#include<stdio.h> int main() { double r,w; printf("enter r"); scanf("%lf",&r); if(r<=0){ printf("输入错误,重新输入"); } else{ if(r<=50){ w=0.53*r; printf("w=%.3f ",w); } else{ w=26.5+0.58*(r-50); printf("w=%.3f ",w); } } return 0; }