求助,好像是定义错了?
程序代码:
#include <stdio.h> #include <conio.h> void main() {long int i,a1,a2,a3,a4,a5,m; scanf("%ld",&i); a1=100000*0.1; a2=a1+100000*0.075; a3=a2+200000*0.05; a4=a3+200000*0.03; a5=a4+400000*0.015; if(i<100000) m=i*0.1; else if(i<200000) m=a1+(i-100000)*0.075; else if(i<400000) m=a2+(i-200000)*0.05; else if(i<600000) m=a3+(i-400000)*0.03; else if(i<1000000) m=a4+(i-600000)*0.015; else m=a5+(i-1000000)*0.01; printf("%ld",m); getch(); }