资源预览内容
第1页 / 共2页
第2页 / 共2页
亲,该文档总共2页全部预览完了,如果喜欢就下载吧!
资源描述
cpp/* Copyright (c) 2012, 烟台大学计算机学院* All rights reserved.* 文件名称:test.cpp* 完成日期:2012 年12月16日* 版本号:v1.0* 输入描述:无* 问题描述:出去字符串中多余的空格* 程序输出:整理好的句子* 问题分析:* 算法设计:略*/#includeusing namespace std;int main()char str=Only one space is allowed between the two words.;cout原始难看的句子:strendl; 天骄无双:www.biwuge.comint i=0,j=0;bool notSpace;while(strj= )j+;notSpace=true;while(strj!=0)if(strj!= )notSpace=true;stri+=strj+;else if(notSpace)notSpace=false;stri+=strj+;elsej+;stri=0;cout整理后的句子:strendl; 升邪:www.zzfeisu.comreturn 0;
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号