各位大佬,这段哪里错的使用,编译不出来
程序代码:
#include<iostream>//包含头文件iostream using namespace std;//使用C++的命名空间std int main() { long int i; double bonus1, bonus2, bonus4, bonus6, bonus10,bonus; bonus1 = 100000* 0.1; bonus2 = bonus1 + (i - 100000)*0.075; bonus4 = bonus2 + (i - 200000)*0.05; bonus6 = bonus4 + (i - 400000)*0.03; bonus10 = bonus6 + (i - 400000)*0.015; cout << "利润:"; cin >> i; if (i <=100000) bonus = i*0.1; else if ( i <= 200000) bonus = bonus1+(i-100000)*0.75; else if (i <= 400000) bonus = bonus2+(i-200000)*0.05; else if (i <= 600000) bonus = bonus4+(i-400000)*0.03; else if (i <= 1000000) bonus = bonus6+(i-600000)*0.015; else bonus = bonus10+(i-1000000)*0.01; cout << "奖金(bonus):" << bonus << endl; return 0; }