Section One
1.1.1
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,N;
- cin >> N;
- while ( cin >>a >>b)
- {
- cout << a+b <<endl;
- }
- return ;
- }
1.1.2
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,N;
- cin >> N;
- for (int i = N; i > ; i--)
- {
- cin >>a >>b;
- cout << a+b <<endl;
- }
- return ;
- }
1.1.3
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b;
- while ((cin >>a >>b) && (a||b))
- {
- cout << a+b <<endl;
- }
- return ;
- }
1.1.4
- #include <iostream>
- using namespace std;
- #define MAXN 1000 + 10 //不能加分号
- int main()
- {
- int N;
- int arr[MAXN] = {};
- // arr[MAXN] ;
- while ((cin >>N) && N)
- {
- int sum = ;
- for (int i=N; i>; i--)
- {
- cin >> arr[i];
- sum += arr[i];
- }
- cout << sum << endl;
- }
- return ;
- }
1.1.5
- #include <iostream>
- using namespace std;
- #define MAXN 1000 + 10 //不能加分号
- int main()
- {
- int N;
- int arr[MAXN] = {};
- // arr[MAXN] ;
- int M;
- cin >> M;
- while ((cin >>N) && (M>))
- {
- M--;
- int sum = ;
- for (int i=N; i>; i--)
- {
- cin >> arr[i];
- sum += arr[i];
- }
- cout << sum << endl;
- }
- return ;
- }
1.1.6
- #include <iostream>
- using namespace std;
- #define MAXN 1000 + 10 //不能加分号
- int main()
- {
- int N;
- int arr[MAXN] = {};
- while ((cin >>N) )
- {
- int sum = ;
- for (int i=N; i>; i--)
- {
- cin >> arr[i];
- sum += arr[i];
- }
- cout << sum << endl;
- }
- return ;
- }
1.1.7
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b;
- while (cin >> a >> b)
- {
- cout << a+b << endl << endl;
- }
- return ;
- }
1.1.8
- #include <iostream>
- using namespace std;
- #define MAXN 1000 + 10 //不能加分号
- int main()
- {
- int N;
- int arr[MAXN] = {};
- int M;
- cin >> M;
- while ((cin >>N) && (M>))
- {
- M--;
- int sum = ;
- for (int i=N; i>; i--)
- {
- cin >> arr[i];
- sum += arr[i];
- }
- (M!=)?(cout << sum << endl << endl):(cout << sum <<endl);
- }
- return ;
- }
Section One的更多相关文章
- keil MDK error: L6236E: No section matches selector - no section 错误
今天板子刚到,新建的第一个工程就报错了. .\Objects\cse.sct(7): error: L6236E: No section matches selector - no section t ...
- 【代码笔记】iOS-一个tableView,两个section
一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController ...
- gcc/linux内核中likely、unlikely和__attribute__(section(""))属性
查看linux内核源码,你会发现有很多if (likely(""))...及if (unlikely(""))...语句,这些语句其实是编译器的一种优化方式,具 ...
- <section> 标签
最近正在学习html5,刚接触html5,感觉有点不适应,因为有一些标签改变了,特别是div, section article这三个标签,查了一些资料,也试着用html5和css3布局网页,稍微有点头 ...
- [ASP.NET MVC 小牛之路]12 - Section、Partial View 和 Child Action
概括的讲,View中的内容可以分为静态和动态两部分.静态内容一般是html元素,而动态内容指的是在应用程序运行的时候动态创建的内容.给View添加动态内容的方式可归纳为下面几种: Inline cod ...
- $\LaTeX$笔记:Section 编号方式(数字、字母、罗马)&计数器计数形式修改
$\LaTeX$系列根目录: Latex学习笔记-序 IEEE模板中Section的编号是罗马数字,要是改投其他刊物的话可能得用阿拉伯数字,所以可以在导言部分做如下修改(放在导言区宏包调用之后): \ ...
- [DOM Event Learning] Section 4 事件分发和DOM事件流
[DOM Event Learning] Section 4 事件分发和DOM事件流 事件分发机制: event dispatch mechanism. 事件流(event flow)描述了事件对象在 ...
- [DOM Event Learning] Section 3 jQuery事件处理基础 on(), off()和one()方法使用
[DOM Event Learning] Section 3 jQuery事件处理基础 on(),off()和one()方法使用 jQuery提供了简单的方法来向选择器(对应页面上的元素)绑定事件 ...
- [DOM Event Learning] Section 2 概念梳理 什么是事件 DOM Event
[DOM Event Learning] Section 2 概念梳理 什么是事件 DOM Event 事件 事件(Event)是用来通知代码,一些有趣的事情发生了. 每一个Event都会被一个E ...
- [DOM Event Learning] Section 1 DOM Event 处理器绑定的几种方法
[DOM Event Learning] Section 1 DOM Event处理器绑定的几种方法 网页中经常需要处理各种事件,通常的做法是绑定listener对事件进行监听,当事件发生后进行一 ...
随机推荐
- java中各种循环
简单介绍一下java中的一些循环 package test; import org.apache.log4j.Logger; import org.junit.Test; public class F ...
- HDU 1159 Common Subsequence (dp)
题目链接 Problem Description A subsequence of a given sequence is the given sequence with some elements ...
- ASP.NET AjaxControlToolkit-Framework4.0 配置实用(简单介绍CalendarExtender日期控件)
1:下载:AjaxControlToolkit Ajax Control Toolkit .NET 4 Ajax Control Toolkit .NET 4.5 Ajax Control Toolk ...
- ImageView设置边框 以及内部图片居中显示 在AndroidStudio中添加shape.xml文件
效果如图 边框设置:shape文件 <shape xmlns:android="http://schemas.android.com/apk/res/android"> ...
- Python3 生成器
生成器(genetor): 1>生成器只有在调用的时候才会生成相应的数据: 2>生成器只记录当前位置,有一个__next__()方法 3>yield可以实现单线程先的并发运算 1.列 ...
- Python【模块】importlib,requests
内容概要: 模仿django中间件的加载方式 importlib模块 requests模块 rsplit() 用实际使用的理解来解释两个模块 importlib模块 ...
- C语言将字符串转换成对应的数字(十进制、十六进制)【转】
转自:http://wawlian.iteye.com/blog/1315133 问题1:讲一个十进制数字的字符串表示转换成对应的整数.举例:将“”转换成整数1234. C代码 收藏代码 /*将字符串 ...
- sicily 1020. Big Integer
Description Long long ago, there was a super computer that could deal with VeryLongIntegers(no VeryL ...
- sql server 学习笔记
1. 修改student表中sdept字段改为varchar类型,长度为30,并且不为空 ) not null 2. 删除student表中的address列 alter table student ...
- C# 网络编程小计 20150202
在学习网络Socket编程之前必须得学会多线程编程,这个是经常会用的到 可参考:http://www.cnblogs.com/GIS_zhou/articles/1839248.html System ...