C++指针变量:输入一个字符串,删除字符串中所有空格,输出删除空格后字符串的长度,需编写以下功能函数

日期:2016-02-21 10:38:31 人气:1

C++指针变量:输入一个字符串,删除字符串中所有空格,输出删除空格后字符串的长度,需编写以下功能函数

//#include "stdafx.h"//vc++6.0加上这一行.#include using namespace std;void input(char *str){ int i=0,ch; while(ch=getchar(),ch!='\n') str[i++]=ch; str[i]='\0';}void trim(char *str){ for(int i
    A+
热门评论