#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)