当前位置:网站首页>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;
}
边栏推荐
- Improve jpopup to realize dynamic control disable
- Codeless June event 2022 codeless Explorer conference will be held soon; AI enhanced codeless tool launched
- 实践分享:如何安全快速地从 Centos迁移到openEuler
- Promise summary
- 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. Login of development blog project
- [Jiudu OJ 07] folding basket
- A master in the field of software architecture -- Reading Notes of the beauty of Architecture
- C Advanced - data storage (Part 1)
- Vulhub vulnerability recurrence 71_ Unomi
猜你喜欢
毕业设计游戏商城
[email protected] raspberry pie"/>
[email protected] raspberry pie
First knowledge database
Codeless June event 2022 codeless Explorer conference will be held soon; AI enhanced codeless tool launched
Analysis of grammar elements in turtle Library
RustDesk 搭建一个自己的远程桌面中继服务器
Embedded interview questions (IV. common algorithms)
自建DNS服务器,客户端打开网页慢,解决办法
清除浮动的方式
03. 开发博客项目之登录
随机推荐
[experience] install Visio on win11
2022 half year summary
Codeforces Round #804 (Div. 2) Editorial(A-B)
[string] palindrome string of codeup
ARTS Week 25
ArcGIS application foundation 4 thematic map making
Redis消息队列
Auto.js学习笔记17:基础监听事件和UI简单的点击事件操作
SQLite add index
Jushan database appears again in the gold fair to jointly build a new era of digital economy
Processes and threads
AUTOSAR from getting started to becoming proficient (10) - embedded S19 file analysis
04. 项目博客之日志
02. Develop data storage of blog project
无代码六月大事件|2022无代码探索者大会即将召开;AI增强型无代码工具推出...
改善Jpopup以实现动态控制disable
Embedded interview questions (I: process and thread)
Download, install and use NVM of node, and related use of node and NRM
How to get list length
Summary of deep learning tuning tricks