| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1553 人关注过本帖
标题:[求助]新手请教C程序中出现的问题
只看楼主 加入收藏
tj8355825
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-4-12
收藏
得分:0 

我改了下但是在if语句时出错
#include <stdio.h>
main()
{
long int i;
double bonus1,bonus2,bonus4,bonus6,bonus10,bonus;
scanf("%ld",&i);
bonus1=100000*0.1;bonus2=bonus1+100000*0.75;
bonus4=bonus2+200000*0.5;
bonus6=bonus4+200000*0.3;
bonus10=bonus6+400000*0.15;
 if(i<=100000)
  bonus=i*0.1;
 else if(i<=200000)
     bonus=bonus1+(i-100000)*0.075;
    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;
printf("bonus=%d",bonus);
}
错误信息如下怎么改
F:\C++练习\1.C(11) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(11) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(12) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(12) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(12) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(12) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(13) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(13) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(14) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(15) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(15) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(15) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(15) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(15) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(15) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(15) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(15) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(16) : error C2146: syntax error : missing ';' before identifier 'bonus'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(17) : error C2181: illegal else without matching if
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(18) : error C2146: syntax error : missing ';' before identifier 'bonus'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : error C2018: unknown character '0xa1'
F:\C++练习\1.C(19) : fatal error C1003: error count exceeds 100; stopping compilation
执行 cl.exe 时出错.

1.exe - 1 error(s), 0 warning(s)

2007-04-14 11:21
旭日潜龙
Rank: 1
等 级:新手上路
帖 子:798
专家分:0
注 册:2007-3-29
收藏
得分:0 
肯定不行了...
bonus10=bonus6+400000*0.15;
double bonus1,bonus2,bonus4,bonus6,bonus10,bonus;
你将bonus6定义为变量,怎么可以出现在右边啊.....
出现的只能这样的错误
错误 noname.c 10: 非法字符 '? (0xa1)在 main 函数中

灌水只发表情!
2007-04-14 12:10
快速回复:[求助]新手请教C程序中出现的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.035034 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved