第13周项目5(2)2连接数组
来源:互联网 发布:ubuntu常用软件 编辑:程序博客网 时间:2024/05/21 21:35
问题及代码:
/* * Copyright (c) 2014, 烟台大学计算机学院 * All rights reserved. * 文件名称:test.cpp * 作 者:李盈盈 * 完成日期:2014年 11 月 24 日 * 版 本 号:v1.0 * * 问题描述:输入str1和str2的值,将str1和str2接起来存放到str3中 * 输入描述:输入str1和str2的值 * 程序输出:输出str3中的值 */#include<iostream>#include<cstdio>using namespace std;int main(){ char str1[20]; char str2[50]; gets(str1); gets(str2); char str3[100]; int i=0,j=0; while(str1[j]!='\0') { str3[i++]=str1[j++]; } j=0; while(str2[j]!='\0') { str3[i++]=str2[j++]; } str3[i]='\0'; cout<<"处理后的字符串是: "<<str3<<endl; return 0;}
运行结果:
0 0
- 第13周项目5(2)2连接数组
- 第13周项目5(2)4-连接数组2
- 第13周项目1-数组大折腾(2)
- 第13周项目1-数组大折腾(2)
- 第13周项目1-数组大折腾(2)
- 第13周项目1(2)-数组大折腾
- 第13周项目1-数组大折腾(2)
- 第13周项目1(2)-数组大折腾
- 第13周项目4(2)字符数组排序
- 第13周项目1-数组大折腾-(2)
- 第13周项目1-数组大折腾(2)
- 第13周 项目1-数组大折腾(2)
- 第13周 项目4-数组的排列(2)
- 第13周项目4-数组的排序(2)
- 第13周项目1-数组大折腾(2)
- 第13周项目4-数组的排序-(2)
- 第13周项目4(2)-字符数组排序
- 第13周项目4-数组的排序(2)
- 各大主流.Net的IOC框架性能测试比较
- PCA人脸识别学习及C语言实现
- C实现选择排序
- SqlParameter的作用与用法
- 留数定理
- 第13周项目5(2)2连接数组
- 触发器(trigger):监视某种情况,并触发某种操作。
- Java RMI学习
- delphi——多线程(1)
- iOS Xcode, 解决“Could not insert new outlet connection”的问题
- [Leetcode]Palindrome Partitioning
- MySQL schema设计中的陷阱
- linux脚本之简单实例
- 调节SecureCRT的字体颜色