C语言比大小

CGFloatgrade =0.0f;

if(loanBelance <3000) {

grade =0.25* loanBelance/3000;

}elseif(loanBelance -3000>0&& loanBelance -10000<0) {

grade =0.25+0.25* ((loanBelance -3000) /7000);

}elseif(loanBelance -10000>0&& loanBelance -20000<0){

grade =0.50+0.25* ((loanBelance -10000) /10000);

}elseif(loanBelance -20000>0&& loanBelance -30000<0) {

grade =0.75+0.25* ((loanBelance -20000) /10000);

}else{

grade =1.0;

}

是争取的,不过

if(loanBelance <3000.00) {

grade =0.25* loanBelance/3000;

}elseif(3000.00< loanBelance <10000.00) {

grade =0.25+0.25* ((loanBelance -3000) /7000);

}elseif(10000.00< loanBelance <20000.00){

grade =0.50+0.25* ((loanBelance -10000) /10000);

}elseif(20000.00< loanBelance <30000.00) {

grade =0.75+0.25* ((loanBelance -20000) /10000);

}else{

grade =1.0;

}

DebugLog(@"%f",grade);if(loanBelance <3000.00) {

grade =0.25* loanBelance/3000;

}elseif(3000.00< loanBelance <10000.00) {

grade =0.25+0.25* ((loanBelance -3000) /7000);

}elseif(10000.00< loanBelance <20000.00){

grade =0.50+0.25* ((loanBelance -10000) /10000);

}elseif(20000.00< loanBelance <30000.00) {

grade =0.75+0.25* ((loanBelance -20000) /10000);

}else{

grade =1.0;

}

DebugLog(@"%f",grade);

这样就会出错

你可能感兴趣的:(C语言比大小)