编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第4章编程练习1
#include <iostream>
//#include <string>
using namespace std;
struct stu
{
char fname[10];//这里若用string fname
char lname[10];//同样这里若用string lname
char grade;
int age;
};
int main()
{
stu stu1;
cout<<"What is first name? ";
cin.getline(stu1.fname,10);//getline(cin,stu1.fname)存在输入两次enter,才会运行到下一句cout<<"What...",??
out<<"What is your last name? ";
cin.getline(stu1.lname,10);
cout<<"What letter grade you deserve? ";
cin>>stu1.grade;
cout<<"What is your age? ";
cin>>stu1.age;
cout<<"Name: "<<stu1.fname<<", "<<stu1.lname<<endl;
cout<<"Grade: "<<(char) (stu1.grade+1)<<endl;
cout<<"Age: "<<stu1.age<<endl;
system("pause");
return 0;
}
编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第4章编程练习1的更多相关文章
- 编程菜鸟的日记-初学尝试编程-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 ...
随机推荐
- JAVA之复制数组
//复制数组 //Arrays.copyOf(arr, 5) //arr:要复制的对象,5为新数组的长度 import java.util.Arrays; public class Cope { pu ...
- Python数据分析几个比较常用的方法
1,表头或是excel的索引如果是中文的话,输出会出错 解决方法:python的版本问题!换成python3就自动解决了!当然也有其他的方法,这里就不再深究 2,如果有很多列,如何输出指定的列? ...
- Hyper-V 替换 vmwp
要激活 Hyper-V 下的虚机 最简单的方法是用带证书的vmwp替换掉原来的 带证书的vmwp参见:http://bbs.pcbeta.com/viewthread-1408240-1-1.html ...
- 牛客网round1
题解: 1. 二分答案之后判断 把式子移项使得x,y不关联 #include <bits/stdc++.h> using namespace std; #define rint regis ...
- net core体系-web应用程序-4net core2.0大白话带你入门-3asp.net core项目架构和配置文件解读
asp.net core web项目目录解读 Connected Services 和传统.net web项目相比,它的功能类似于添加webservice或者wcf service的引用.暂时用不 ...
- MyEclipse 安装插件 Github安装/使用 教程
2016年02月18日 09:45:23 阅读数:4531 本文的目的是 1.在 Myeclipse10.7中 集成Github并使用. 选择的安装方式是:MyEclipse 中设置下文中1后,下载g ...
- php json_encode转换中文乱码
$arr = ["a"=>'范德萨似懂非懂']; echo json_encode($arr,JSON_UNESCAPED_UNICODE);
- BZOJ3675 [Apio2014]序列分割 动态规划 斜率优化
原文链接http://www.cnblogs.com/zhouzhendong/p/8697258.html 题目传送门 - BZOJ3675 题意 对于一个非负整数序列,小H需要重复k次以下的步骤: ...
- python必看经典书籍:笨办法学python
书评: 感谢作者和译者,很好的手把手的一个新手编程体验书,消除编程物质恐惧感,在线看的liam huang翻译的版,不确定看的是第几版,有一些加分题没有做,第五十题黑手党外星人飞船做起来有点压力,准备 ...
- day 42 mycql 数据类型
关于性别字段的存储数据类型选用 -- 性别字段 create table actor2 (id int not null auto_increment primary key,name char(32 ...