当前位置:网站首页>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;
}
边栏推荐
- 数字经济破浪而来 ,LTD是权益独立的Web3.0网站?
- 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
- Classes and objects (I) detailed explanation of this pointer
- Note the various data set acquisition methods of jvxetable
- Station B Liu Erden - linear regression and gradient descent
- 01. Project introduction of blog development project
- [string] palindrome string of codeup
- ArcGIS application foundation 4 thematic map making
- Garbage collector with serial, throughput priority and response time priority
- PDK process library installation -csmc
猜你喜欢
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_
C Advanced - data storage (Part 1)
Easy to understand IIC protocol explanation
Pointer classic written test questions
26file filter anonymous inner class and lambda optimization
Deep learning -yolov5 introduction to actual combat click data set training
初识数据库
移植InfoNES到STM32
随机推荐
Easy to understand IIC protocol explanation
移植InfoNES到STM32
毕业设计游戏商城
Embedded interview questions (IV. common algorithms)
[force buckle]43 String multiplication
First knowledge database
【torch】|torch.nn.utils.clip_grad_norm_
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
Embedded interview questions (I: process and thread)
UCF (2022 summer team competition I)
HAC cluster modifying administrator user password
Safe mode on Windows
B站刘二大人-数据集及数据加载 Lecture 8
Sword finger offer II 039 Maximum rectangular area of histogram
AUTOSAR from getting started to becoming proficient (10) - embedded S19 file analysis
应用安全系列之三十七:日志注入
Improve jpopup to realize dynamic control disable
Vulhub vulnerability recurrence 71_ Unomi
Remember an error in MySQL: the user specified as a definer ('mysql.infoschema '@' localhost ') does not exist
ArcGIS应用基础4 专题图的制作