注册 登录
编程论坛 C++教室

自己写的程序,老是报错

追着季风飞吧 发布于 2014-12-20 11:49, 458 次点击
#include<stdio.h>
#include<math.h>
int main()
{
    double money,t,q,temp;
    printf("请输入个税起征点:");
    printf("\n");
    printf("请输入您的工资:");
  scanf("%lf%lf",&q,&money);
  t=money-q;
    if(t<500)temp=t*0.05;
    else if(t<2000&&t>=500)
      temp=t*0.1;
    else if(t<5000&&t>=2000)
      temp=t*0.15;
    else if(t<20000&&t>=5000)
      temp=t*0.2;
    else if(t<40000&&t>=20000)
      temp=t*0.25;
    else if(t<60000&&t>=40000)
      temp=t*0.3;
    else if(t<80000&&t>=60000)
        temp=t*0.35;
    else if(t<100000&&t>=80000)
        temp=t*0.4; 
    else
  temp=t*0.4;
    printf("应缴纳税款为:%lf",temp);
    return 0;
}
在scanf处老是报错“error C2018: unknown character '0xa1'”,可是我之前有定义,搞不懂,求大神指教
3 回复
#2
yangfrancis2014-12-21 09:26
解答不了,关注一下而已。
#3
yangfrancis2014-12-21 21:48
我自己试了一下把scanf("%lf%lf",&q,&money);里面的两个l去掉就可以正常运行了。原因说不清楚。
#4
rjsp2014-12-22 09:46
error C2018: unknown character '0xa1'
--- asc码在0x00至0x7F之间,既然出现了未知字符0xa1,那你有没有仔细去找找呢?
“  scanf("%lf%lf",&q,&money);”最前面是两个中文全角的空格。
1