急急急!高分悬赏!C++题答案!望高手指教

2024-12-27 22:22:24
推荐回答(3个)
回答1:

1.
3,3,4,9

2.
C,e

3.
k=0,m=6

回答2:

1.<3,3,4,9>
2.
3.
还问吗?运行下不就可以了吗??????????

回答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