’‘’cpp
include[HTML_REMOVED]
int numstr(chars)
{
int y=0;
for(int i=0;i<13;i)
{
if(*(s+i)==’ ‘)
y;
}
return y+1;
}
void dx(chars)
{
for(int i=0;i<=sizeof(s);i++)
switch((s+i))
{
case ‘w’:(s+i)=’W’;break;
case ‘e’:(s+i)=’E’;break;
case ‘c’:(s+i)=’C’;break;
case ‘a’:(s+i)=’A’;break;
case ‘n’:(s+i)=’N’;break;
case ‘d’:(s+i)=’D’;break;
case ‘o’:(s+i)=’O’;break;
}
}
int main(){
char s[]=”we can do IT”;
printf(s);
printf(“\nnuber of words: %d \n”, numstr(s)); // 显示4
dx(s);
printf(s); // 显示WE CAN DO IT
return 0;
}
‘’‘