九度OJ 1039:Zero-complexity Transposition(逆置) (基础题)
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:3093
解决:1255
- 题目描述:
-
You are given a sequence of integer numbers. Zero-complexity transposition of the sequence is the reverse of this sequence. Your task is to write a program that prints zero-complexity transposition of the given sequence.
- 输入:
-
For each case, the first line of the input file contains one integer n-length of the sequence (0 < n ≤ 10 000). The second line contains n integers numbers-a1, a2, …, an (-1 000 000 000 000 000 ≤ ai ≤ 1 000 000 000 000 000).
- 输出:
-
For each case, on the first line of the output file print the sequence in the reverse order.
- 样例输入:
-
5
-3 4 6 -8 9
- 样例输出:
-
9 -8 6 4 -3
思路:
数组倒序。注意用long long类型存储。
代码:
#include <stdio.h> #define N 10000 int main(void)
{
int n, i;
long long a[N]; while (scanf("%d", &n) != EOF)
{
for(i=0; i<n; i++)
scanf("%lld", &a[i]); for(i=n-1; i>0; i--)
printf("%lld ", a[i]);
printf("%lld\n", a[i]);
} return 0;
}
/**************************************************************
Problem: 1039
User: liangrx06
Language: C
Result: Accepted
Time:0 ms
Memory:916 kb
****************************************************************/
九度OJ 1039:Zero-complexity Transposition(逆置) (基础题)的更多相关文章
- 九度oj 题目1055:数组逆置
题目1055:数组逆置 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:8225 解决:3932 题目描述: 输入一个字符串,长度小于等于200,然后将数组逆置输出. 输入: 测试数据有多组 ...
- 九度OJ 1192:回文字符串 (基础题)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:3807 解决:1778 题目描述: 给出一个长度不超过1000的字符串,判断它是不是回文(顺读,逆读均相同)的. 输入: 输入包括一行字符串 ...
- 九度OJ 1033:继续xxx定律 (基础题)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:4987 解决:1201 题目描述: 当n为3时,我们在验证xxx定律的过程中会得到一个序列,3,5,8,4,2,1,将3称为关键数, ...
- 九度OJ 1058:反序输出 (基础题)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:8454 解决:3042 题目描述: 输入任意4个字符(如:abcd), 并按反序输出(如:dcba) 输入: 题目可能包含多组用例,每组用例 ...
- 九度OJ 1053:互换最大最小数 (基础题)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:6613 解决:2676 题目描述: 输入一个数n,然后输入n个数值各不相同,调换数组中最大和最小的两个数,然后输出. 输入: 测试数据有多组 ...
- 九度OJ 1048:判断三角形类型 (基础题)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:6794 解决:3361 题目描述: 给定三角形的三条边,a,b,c.判断该三角形类型. 输入: 测试数据有多组,每组输入三角形的三条边. 输 ...
- 九度OJ 1045:百鸡问题 (基础题)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:8410 解决:3644 题目描述: 用小于等于n元去买100只鸡,大鸡5元/只,小鸡3元/只,还有1/3元每只的一种小鸡,分别记为x只,y只 ...
- 九度OJ 1015:还是A+B (基础题)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:6773 解决:4031 题目描述: 读入两个小于10000的正整数A和B,计算A+B.需要注意的是:如果A和B的末尾K(不超过8)位数字相同 ...
- 九度OJ 1128:求平均年龄 (基础题)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:2080 解决:1084 题目描述: 班上有学生若干名,给出每名学生的年龄(整数),求班上所有学生的平均年龄,保留到小数点后两位. 输入: 第 ...
随机推荐
- python 设计模式之MVC模式
一.简单介绍 mvc模式 the model-view-controller pattern mvc模式是一个运用在软件工程中的设计模式.mvc模式脱离了以前简单的web服务设计逻辑,将开发,测试 ...
- VisualStudio 2013 Prieview体验
今天看到VisualStudio 2013的预览版发布了,便立即下载试用了一下. 主体界面和VS2012非常类似,不过色彩要稍微丰富点. 现在支持用MS账户登录了,登陆后可以同步设置,这个小功能还是比 ...
- 查找python项目依赖并生成requirements.txt
1.如果使用virtualenv环境,直接使用 pip freeze > requirements.txt ➜ ~ .virtualenvs/xxx/bin/pip freeze > r ...
- GEOS 使用的例子
typedef Coordinate PT;geos::geom::Geometry* CGlbGlobePolygonSymbol::Interection(CGlbPolygon *geom, C ...
- java基础篇6之代理
代理的概念与应用 Class clazzProxy = Proxy.getProxyClass(Collection.class.getClassLoader,Collection.class); c ...
- http Keep-Alive
1.什么是Keep-Alive模式? 我们知道HTTP协议采用“请求-应答”模式,当使用普通模式,即非KeepAlive模式时,每个请求/应答客户和服务器都要新建一个连接,完成之后立即断开连接(HTT ...
- java命令行
Launches a Java application. Synopsis java [options] classname [args] java [options] -jar filename [ ...
- vue2.0 仿手机新闻站(四)axios
1.axios的配置 main.js import Vue from 'vue' import App from './App.vue' // 引入 路由 import VueRouter from ...
- UNP学习笔记(第十七章 ioctl操作)
ioctl相当于一个杂物箱,它一直作为那些不适合归入其他精细定义类别的特性的系统接口. 本章笔记先放着,到时候有需要再看 ioctl函数 #include <unistd.h> int i ...
- 【Excle数据透视】二维数据如何创建数据透视表
二维数据在创建数据透视表的时候,可能会给你带来一些麻烦,没法创建,会丢失维度,那怎么办呢? 解决办法:使用数据透视表和数据透视图向导即可创建 具体操作如下: 按下[Alt+D+P],出现如下界面 选择 ...