1.
3,3,4,9
2.
C,e
3.
k=0,m=6
1.<3,3,4,9>
2.
3.
还问吗?运行下不就可以了吗??????????
1. #include
void main()
{ char *ps="wdka345aakk89gddxky";
int a=0,b=0,c=0,d=0;
for(;*ps;ps++)
switch(*ps)
{ case ‘a’:a++; break;
case ‘d’:b++; break;
case ‘k’:c++; break;
default: d++;
}
cout<< a <<","<}
输出结果为:
3,3,4,9
2. #include
void main()
{ char c1,c2;
c1=‘A’+‘4’-‘2’; c2=‘a’-‘2’ +‘6’;
cout<
输出结果为:
C,e
3. #include
void main()
{ int i,j,k=0,m=0;
for(i=0;i<3;i++)
{ for(j=0;j<3;j++)k++,k-=j; }
m=i+j;
cout<<"k="<
输出结果为:
k=0,m=6