考虑x不同取值y的不同计算方式
#include <cstdio> int main() { float x,y; scanf("%f",&x); if(x<=15) { y=4*x/3; } else{ y=2.5*x-17.5; } //cout<<y; printf("%.2f ",y); return 0; }