标题:为什么运行不了啊,我改了多次还是存在错误!
只看楼主
feelings010
Rank: 1
等 级:新手上路
帖 子:63
专家分:0
注 册:2007-4-20
 问题点数:0 回复次数:4 
为什么运行不了啊,我改了多次还是存在错误!

#include<stdio.h>
#include<iostream.h>
void main()
{
char c[]=”0123456789001112222”
int i0=0,i1=0,i2=0;
for (int i=0;i<19;i++){
switch(c[i])
{ case’0’:i0++;break;
case’1’:i1++;break;
case’2’:i2++;break;
default:break;
}
}
cout<<”i0=”<<i0<<endl;
cout<<”i1=”<<i1<<endl;
cout<<”i2=”<<i2<<endl;
}


运行这个的时候也是有错误,请各位也帮下忙,谢谢!其错误如下所示:
--------------------Configuration: ddkl - Win32 Debug--------------------
Compiling...
ddkl.cpp
C:\C程序算法\ddkl.cpp(5) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(5) : error C2018: unknown character '0xb1'
C:\C程序算法\ddkl.cpp(5) : error C2041: illegal digit '8' for base '8'
C:\C程序算法\ddkl.cpp(5) : error C2041: illegal digit '9' for base '8'
C:\C程序算法\ddkl.cpp(5) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(5) : error C2018: unknown character '0xb1'
C:\C程序算法\ddkl.cpp(6) : error C2440: 'initializing' : cannot convert from 'const __int64' to 'char []'
There are no conversions to array types, although there are conversions to references or pointers to arrays
C:\C程序算法\ddkl.cpp(6) : error C2144: syntax error : missing ';' before type 'int'
C:\C程序算法\ddkl.cpp(9) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(9) : error C2018: unknown character '0xaf'
C:\C程序算法\ddkl.cpp(9) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(9) : error C2018: unknown character '0xaf'
C:\C程序算法\ddkl.cpp(10) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(10) : error C2018: unknown character '0xaf'
C:\C程序算法\ddkl.cpp(10) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(10) : error C2018: unknown character '0xaf'
C:\C程序算法\ddkl.cpp(11) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(11) : error C2018: unknown character '0xaf'
C:\C程序算法\ddkl.cpp(11) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(11) : error C2018: unknown character '0xaf'
C:\C程序算法\ddkl.cpp(15) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(15) : error C2018: unknown character '0xb1'
C:\C程序算法\ddkl.cpp(15) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(15) : error C2018: unknown character '0xb1'
C:\C程序算法\ddkl.cpp(15) : error C2059: syntax error : '<<'
C:\C程序算法\ddkl.cpp(16) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(16) : error C2018: unknown character '0xb1'
C:\C程序算法\ddkl.cpp(16) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(16) : error C2018: unknown character '0xb1'
C:\C程序算法\ddkl.cpp(16) : error C2059: syntax error : '<<'
C:\C程序算法\ddkl.cpp(17) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(17) : error C2018: unknown character '0xb1'
C:\C程序算法\ddkl.cpp(17) : error C2018: unknown character '0xa1'
C:\C程序算法\ddkl.cpp(17) : error C2018: unknown character '0xb1'
C:\C程序算法\ddkl.cpp(17) : error C2059: syntax error : '<<'
执行 cl.exe 时出错.

ddkl.obj - 1 error(s), 0 warning(s)

搜索更多相关主题的帖子: break case cout endl 运行 
2007-05-21 17:26
边城路人
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:9
帖 子:591
专家分:0
注 册:2007-3-8
得分:0 
char *c=”0123456789001112222”;

当你开始怀疑自己时,说明你已经失去了判断力
2007-05-21 17:37
jhx232
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-4-16
得分:0 
#include<stdio.h>
#include<iostream.h>
void main()
{
char c[]="0123456789001112222";
int i0=0,i1=0,i2=0;
for (int i=0;i<19;i++){
switch(c[i])
{ case '0':i0++;break;
case '1':i1++;break;
case '2':i2++;break;
default:break;
}
}
cout<<"i0="<<i0<<endl;
cout<<"i1="<<i1<<endl;
cout<<"i2="<<i2<<endl;
}
第五行漏了";",还有你的双引号应是",而不是”
2007-05-28 12:27
边城路人
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:9
帖 子:591
专家分:0
注 册:2007-3-8
得分:0 
楼上很细心阿

当你开始怀疑自己时,说明你已经失去了判断力
2007-05-28 19:21
bloodlegend
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-3-1
得分:0 

nod,“"在vc中是需要注意的

2007-05-28 23:31



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-141225-1-1.html




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

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