编程菜鸟的日记-初学尝试编程-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 ...
随机推荐
- mysql 简称
一:DTS(Data Transformation Service) 数据转换服务 大多数组织都使用多种格式和多个位置来存储数据. 为了支持决策.改善系统性能或对现有系统进行升级,经常必须将数据从一个 ...
- python--使用队列结构来模拟烫手山芋的游戏
基本功,磨起来. # coding = utf-8 class Queue: def __init__(self): self.items = [] def is_empty(self): retur ...
- 【转】flannel网络的VXLAN及host-gw
http://www.fly63.com/article/detial/1738 VXLAN是Linux内核本身支持的一种网络虚拟化技术,是内核的一个模块,在内核态实现封装解封装,构建出覆盖网络,其实 ...
- js中类定义函数时用prototype与不用的区别
转载自:https://blog.csdn.net/yexudengzhidao/article/details/72866047 先看例子 function ListCommon2(first,se ...
- ASP.NET Core Middleware管道介绍
public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.Use(async (context, ne ...
- 【转】Crosswalk入门
原文:https://www.mobibrw.com/2015/1934 Crosswalk是一款开源的web引擎.目前Crosswalk正式支持的移动操作系统包括Android和Tizen,在And ...
- 第四次作业之oop
第四次作业 四则运算 类 输入类:用户输入题数和答案,语言选择. 生成类:随机数字,运算符,生成表达式. 读取类:读取表达式,计算正确答案. 界面类:选择语言,输出正确题数和答案. 类与类之间是如何进 ...
- NOIP2017提高组Day2T3 列队 洛谷P3960 线段树
原文链接https://www.cnblogs.com/zhouzhendong/p/9265380.html 题目传送门 - 洛谷P3960 题目传送门 - LOJ#2319 题目传送门 - Vij ...
- day 49-css补充(终结)[浮动和定位]
老师的笔记: 前情回顾: day49 混乱即阶梯. 1. 前情回顾 HTML HTTP和HTML 文档机构 <!Doctype html> HTML head <meta> & ...
- server client 套接字连接
server端: 1. 阻塞型套接字,不能满足多个客户端同时访问 import socket server = socket.socket() server.bind((""127 ...