当前位置:网站首页>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;
}
边栏推荐
- Game push: image / table /cv/nlp, multi-threaded start!
- 应用安全系列之三十七:日志注入
- After the project is released, index Html is cached
- Algorithm -- climbing stairs (kotlin)
- 通讯录管理系统链表实现
- [email protected] raspberry pie
- [QNX hypervisor 2.2 user manual]6.3.3 using shared memory (shmem) virtual devices
- Jushan database appears again in the gold fair to jointly build a new era of digital economy
- Summary of deep learning tuning tricks
- Selective parameters in MATLAB functions
猜你喜欢

数字经济破浪而来 ,LTD是权益独立的Web3.0网站?

Sword finger offer II 039 Maximum rectangular area of histogram

Deep learning -yolov5 introduction to actual combat click data set training

剑指 Offer II 039. 直方图最大矩形面积

Station B, Master Liu Er - dataset and data loading

Station B Liu Erden softmx classifier and MNIST implementation -structure 9

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

移植InfoNES到STM32

Remember an error in MySQL: the user specified as a definer ('mysql.infoschema '@' localhost ') does not exist

Redis消息队列
随机推荐
【云原生】3.1 Kubernetes平台安装KubeSpher
26file filter anonymous inner class and lambda optimization
【华为机试真题详解】检查是否存在满足条件的数字组合
剑指 Offer II 039. 直方图最大矩形面积
B站刘二大人-反向传播
[JVM] [Chapter 17] [garbage collector]
First acquaintance with CDN
(column 22) typical column questions of C language: delete the specified letters in the string.
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
03. 开发博客项目之登录
05. Security of blog project
Station B, Master Liu Er - back propagation
算法-- 爬楼梯(Kotlin)
04. Project blog log
Self built DNS server, the client opens the web page slowly, the solution
js Array 列表 实战使用总结
Station B Liu Erden linear regression pytoch
【经验】UltralSO制作启动盘时报错:磁盘/映像容量太小
Unity gets the width and height of Sprite
通讯录管理系统链表实现