当前位置:网站首页>Luogu [Beginner Level 4] array p1427 number game of small fish
Luogu [Beginner Level 4] array p1427 number game of small fish
2022-07-06 05:43:00 【Python's path to immortality】
P1427 Little fish's number game
Title Description
Xiaoyu was recently asked to participate in a number game , Ask it to put the string of numbers it sees ai( The length doesn't have to be , With 0 end ), Remember it and read it backwards ( Number indicating the end 0 Don't read it out ). This is too difficult for the little fish's memory , You don't think about how big the whole head of a small fish is , Some of them are delicious meat ! So please help Xiaoyu program to solve this problem .
Input format
Enter a string of integers in a line , With 0 end , In space .
Output format
Output this string of integers backwards in a line , In space .
I/o sample
Input #1 Copy
3 65 23 5 34 1 30 0
Output #1 Copy
30 1 34 5 23 65 3
explain / Tips
Data scale and agreement
about 00% The data of , Guarantee
0
≤
a
i
≤
2
31
−
10
0 \leq a_i \leq 2^{31} - 10
0≤ai≤231−10
No more than 100.
Topics of simple reverse order output
AC Code (C++)
#include <iostream>
#include <array>
using namespace std;
int main()
{
array<int, 110>arr;
int temp = 0;
int i = 0;
while (1)
{
cin >> temp;
// Terminate at zero
if (temp == 0)
break;
arr[i++] = temp;
}
// Output in reverse order
for (i-- ; i >= 0; i--)
cout << arr[i] << " ";
return 0;
}
边栏推荐
- Web Security (VI) the use of session and the difference between session and cookie
- Web Security (V) what is a session? Why do I need a session?
- 05. Security of blog project
- Problems encountered in installing mysql8 on MAC
- 通讯录管理系统链表实现
- Game push: image / table /cv/nlp, multi-threaded start!
- What impact will frequent job hopping have on your career?
- SequoiaDB湖仓一体分布式数据库2022.6月刊
- Vulhub vulnerability recurrence 73_ Webmin
- 02. 开发博客项目之数据存储
猜你喜欢
Questions d'examen écrit classiques du pointeur
Safe mode on Windows
Vulhub vulnerability recurrence 67_ Supervisor
PDK process library installation -csmc
B站刘二大人-Softmx分类器及MNIST实现-Lecture 9
Download, install and use NVM of node, and related use of node and NRM
Summary of deep learning tuning tricks
Yygh-11-timing statistics
[SQL Server fast track] - authentication and establishment and management of user accounts
How can large websites choose better virtual machine service providers?
随机推荐
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
【torch】|torch.nn.utils.clip_grad_norm_
04. 项目博客之日志
数字经济破浪而来 ,LTD是权益独立的Web3.0网站?
Quantitative description of ANC noise reduction
Jvxetable implant j-popup with slot
03. Login of development blog project
Anti shake and throttling are easy to understand
02. 开发博客项目之数据存储
Station B Liu Erden - linear regression and gradient descent
Redis message queue
毕业设计游戏商城
【经验】win11上安装visio
Station B, Master Liu Er - back propagation
[experience] when ultralso makes a startup disk, there is an error: the disk / image capacity is too small
通讯录管理系统链表实现
Jvxetable用slot植入j-popup
Clear floating mode
03. 开发博客项目之登录
巨杉数据库再次亮相金交会,共建数字经济新时代