#include
int main()
{
using namespace std;
int ch;
double tvarps;
cout << "your tvarp: " << endl;
while (cin >> ch && ch > 0 )
{
if(ch <= 5000 && ch >0)
tvarps = 0.0;
else if(ch > 5000 && ch <= 15000)
tvarps = ch * 0.1;
else if(ch > 15000 && ch <=35000 )
tvarps = (ch - 15000)*0.15 + 1000;
else if(ch > 35000)
tvarps = (ch - 35000)*0.2 + 4000;
cout << "tvarps: " << tvarps << endl;
}
return 0;
}
回复 _iiiiiii :我的意思是vc++的cctype头文件里有isdigit这个函数。是判断输入是不是数字,我就想问这个函数在我这怎么用