编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习5
#include <iostream>
using namespace std;
const MAXSIZE=12;
const year=3;
int main()
{
char *month[MAXSIZE]={"Janury","February","March","April","May","June","July","August","September","October","November","December"};
int a[year][MAXSIZE];
int sum[year]={0,0,0};
int sumY=0;
for(int i=0;i<year;i++)
{
cout<<"第"<<i+1<<"年的每个月的销量"<<endl;
for(int j=0;j<MAXSIZE;j++)
{
cout<<month[j]<<": ";
cin>>a[i][j];
sum[i]+=a[i][j];
}
cout<<"第"<<i+1<<"年的总销量: "<<sum[i]<<endl;
sumY+=sum[i];
}
cout<<"三年总销售量"<<sumY<<endl;
system("pause");
return 0;
}
编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习5的更多相关文章
- 编程菜鸟的日记-初学尝试编程-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 ...
随机推荐
- Prometheus-配置解析
1.Prometheus整体架构图 2.配置文件 # 全局配置 global: scrape_interval: 15s # 多久 收集 一次数据 evaluation_interval: 30s # ...
- 四大解析器(BeautifulSoup、PyQuery、lxml、正则)性能比较
用标题中的四种方式解析网页,比较其解析速度.当然比较结果数值与电脑配置,python版本都有关系,但总体差别不会很大. 下面是我的结果,lxml xpath最快,bs4最慢 ==== Python v ...
- Love Me,Love My Dog
Love me, love my dog. 爱屋及乌. 出处<尚书大传•大战>:“爱人者,兼其屋上之乌.” 活学活用:love first love 初恋 unrequited [one- ...
- [物理学与PDEs]第1章第9节 Darwin 模型 9.1 拟静电模型及其修正形式
1. 拟静电模型: 当 $\cfrac{\omega}{c}\ll \cfrac{1}{c}\lra \omega\ll \cfrac{c}{l}$ 时, $$\bex \cfrac{1}{c}\cf ...
- 五十一、进程间通信——System V IPC 之进程信号量
51.1 进程信号量 51.1.1 信号量 本质上就是共享资源的数目,用来控制对共享资源的访问 用于进程间的互斥和同步 每种共享资源对应一个信号量,为了便于大量共享资源的操作引入了信号量集,可对所有信 ...
- Ubuntu18.04问题记录
1. pip install 包时偶然间碰上了如下问题: Could not install packages due to an EnvironmentError: [Errno 13] 权限不够: ...
- ps常用指令集
M DCtrl+ D清空选择区域Ctrl+ R调出标尺
- pythonのsimple_tag
当我们需要在页面种直接调用py文件中的某些方法时,我们就要用到simple_tag.具体步骤如下: 1.在某个app下创建templatetags文件夹,切记该名称是不可以改变的. 2.在该文件夹下创 ...
- blinker库
参考 Blinker Documentation Blinker 是一个基于Python的强大的信号库,它既支持简单的对象到对象通信,也支持针对多个对象进行组播.Flask的信号机制就是基于它建立的. ...
- ubuntu 16.04扩充root 分区
ubuntu使用过程中,提示root分区剩余空间不足,剩余200多M时还可以进行一些操作,剩余几M时拷贝等命令都不能够执行. 扩充root分区步骤如下: 1.查看root分区所在位置: 命令: sud ...