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对事件进行监听,当事件发生后进行一 ...
随机推荐
- loj516 「LibreOJ β Round #2」DP 一般看规律
传送门:https://loj.ac/problem/516 [题解] 那段代码求的是相同的数中间隔最小的值. 离散后用set维护每个值出现次数,每次操作相当于合并两个set,这步可以启发式合并. 加 ...
- 计蒜客 Goldbach Miller_Rabin判别法(大素数判别法)
题目链接:https://nanti.jisuanke.com/t/25985 题目: Description: Goldbach's conjecture is one of the oldest ...
- 2009 Round2 A Crazy Rows (模拟)
Problem You are given an N x N matrix with 0 and 1 values. You can swap any two adjacent rows of the ...
- urllib3使用指南
对比urllib,用urllib3处理http请求十分方便,可以嵌入web服务后端用于访问其它web实例提供的接口 一.安装 pip install urllib3 二.初始化 导入urllib3 i ...
- Python与RPC -- (转)
XML-RPC xmlrpc是使用http协议做为传输协议的rpc机制,使用xml文本的方式传输命令和数据. 一个rpc系统,必然包括2个部分: 1)rpc client,用来向rpc server调 ...
- Vue基本指令
模板对象 vue指令 一:模板对象 <!DOCTYPE html> <html lang="en"> <head> <meta chars ...
- Android 6.0 Marshmallow root 方法
android 6.0 已经推出 release 版本了, nexus 5,6,7,9 都放了官方镜像, 本篇文章使用 nexus 6 安装最新的 android 6.0 并进行root step 1 ...
- openboot的项目
http://docs.oracle.com/cd/E19201-01/821-0901-10/OK_OBP.html https://www.openfirmware.info/OpenBIOS h ...
- 获取并编译最新的Notepad++源码
获取并编译最新的Notepad++源码 http://blog.csdn.net/u012814856/article/details/68947310 Notepad++源码编译及其分析 http: ...
- 【NOIP2016】补题
今天突然想到自己居然还没把NOIP2016补完 简直是傻逼... 所以开始写 D1T1:模拟 D1T2:NOIP最难的一道题,首先求LCA 离线下,把观察员单独提出来 然后可以维护一个类似桶排序的东西 ...