这是我写的一部分,不过功能没有实现 ,不知道有谁能帮我解决一下,谢谢了!#include<iostream>
#include<string>
#include<stdio>
using namespace std;
char KongGe(char str[4],int n);
void main()
{
int i;
const int max=4;
char str[max];
cout<<"请输入字符串"<<endl;
for(int j=0;j<=max;j++)
gets(str[j],j);
cout<<"原来的字符串是:"<<endl;
for(int j=0;j<=max;j++)
puts(str[j]);
cout<<"处理完后的字符串是:"<<endl;
char ChuLi=KongGe(str,max);
cout<<ChuLi<<endl;
}
char KongGe(char str[4],int n)
{
for(int m=0;m<n;m++)
{
if(str[n]==32)
{
n++;
}
}
return *str;
}