文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 高等教育 > 理学 > C++Primer Plus(第6版)中文版编程练习答案--第四章
侵权投诉

C++Primer Plus(第6版)中文版编程练习答案--第四章

C++Primer Plus(第6版)中文版编程练习答案--第四章。程序是唐刀自己在学习的过程中自己编写的,其中可能存在错误和不足,大家当做参考就好。

cout<<"enteryourname:"<<endl;

getline(cin,name);

cout<<"enteryourfavouritedessert:"<<endl;

getline(cin,dessert);

cout<<"Ihavesomedelicious"<<dessert<<"foryou,"<<name<<endl;

}

3.

#include<iostream>

#include<string>

#include<cstring>

usingnamespacestd;

voidmain()

{

charfirst_name[20];

charlast_name[20];

cout<<"enteryourfirstname:"<<endl;

cin.getline(first_name,20);

cout<<"enteryourlastname:"<<endl;

cin.getline(last_name,20);

cout<<"hereistheinformationinasinglestring:"<<strcat(strcat(first_name,","),last_name)<<endl;}

4.

#include<iostream>

#include<string>

#include<cstring>

usingnamespacestd;

voidmain()

{

stringfirst_name;

stringlast_name;

cout<<"enteryourfirstname:"<<endl;

getline(cin,first_name);

上一页第2页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email