编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第4章编程练习3
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char fname[20];
char lname[20];
char name[45];
cout<<"Enter your first name: ";
cin.getline(fname,20);
cout<<"Enter your last name: ";
cin.getline(lname,20);
strcpy(name,lname);
strcat(name,", ");
strcat(name,fname);
cout<<"Here's the information in a single string: "<<name<<endl;
system("pause");
return 0;
}
运行结果:
Enter your first name: Flip
Enter your last name: Fleming
Here's the information in a single string: Fleming, Flip
编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第4章编程练习3的更多相关文章
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习9
#include <iostream> #include <fstream> #include <cstdlib> #include <string> ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习8
#include <iostream> #include <fstream> #include <cstdlib> const int SIZE=20; using ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习7
#include <iostream> #include <string> #include <cctype> using namespace std; int m ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习6
#include <iostream> #include <string> using namespace std; const int MSIZE=100; struct j ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习5
#include <iostream> using namespace std; const double N1=35000; const int N2=15000; const int ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习4
#include <iostream> using namespace std; const int strsize=30; const int BOPSIZE=5; void showm ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习3
#include <iostream> using namespace std; void showmenu(void) { cout<<"Please enter ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习2
#include <iostream> #include <cctype> using namespace std; const int MAXSIZE=10; int mai ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习1
#include <iostream>#include <cctype>using namespace std;int main(){ char ch; while((ch=c ...
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习9
#include <iostream>using namespace std;int main(){ int num; cout<<"Enter number of ...
随机推荐
- 用servlet打内容到网页上
关键代码 response.setContentType("text/html;charset=UTF-8"); PrintWriter out=response.getWrite ...
- 将txt文本转换为excel格式
将txt文本转换为excel格式,中间使用的列分割为 tab 键 一.使用xlwt模块 注:Excel 2003 一个工作表行数限制65536,列数限制256 需要模块:xlwt 模块安装:xlwt ...
- K3 WISE 开发插件《SQL语句WHERE查询-范围查询/模糊查询》
0.存储过程开头变量定义 @FBeginDate varchar(10), --单据起始日期 @FEndDate varchar(10), --单据截止日期. @FItemID varchar(50) ...
- python--使用队列结构来模拟共享打印机等候时间
按书里的样例抄的. 可以看到,将打印速度由第分钟5页提高到10页之后, 每个学生提交打印任务到打印完成的时间明显缩短. =========================== 在计算机科学实验室里考虑 ...
- GO语言之urfave/cli命令行解析
练习URL: https://blog.csdn.net/sd653159/article/details/83381786 相信只要部署过线上服务,都知道启动参数一定是必不可少的,当你在不同的网络. ...
- 使用SecureCRT脚本备份网络设备配置的一点感悟
https://blog.csdn.net/qq_25294171/article/details/85158458
- [转] 对express中next函数的一些理解
最近公司在使用node做前后端分离,采用的web框架是express,所以对express框架进行了深入的了解,前段时间写了篇关于express路由的文章,但是在那篇文章中貌似少了一个很重要的内容,就 ...
- Spring Boot JPA的Column Table 注解命名字段无效
@Table(name = "OrderInfo") @Entity public class OrderInfo { @Id @GeneratedValue private Lo ...
- javascript var变量删除
var有三种声明的情形: var声明的全局变量 var在函数范围内声明的局部变量 eval中声明的全局变量. 首先, 1.2种情形var声明的变量是无法删除的. 尽管var声明的全局变量是属于wind ...
- 选择结构switch
1.选择结构switch switch 条件语句也是一种很常用的选择语句,它和if条件语句不同,它只能针对某个表达式的值作出判断,从而决定程序执行哪一段代码.例如,在程序中使用数字1~7来表示星期一到 ...