当前位置:网站首页>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 (V) what is a session? Why do I need a session?
- 巨杉数据库再次亮相金交会,共建数字经济新时代
- How to get list length
- 【SQL server速成之路】——身份驗證及建立和管理用戶賬戶
- 移植InfoNES到STM32
- Pay attention to the details of pytoch code, and it is easy to make mistakes
- RustDesk 搭建一个自己的远程桌面中继服务器
- 嵌入式面试题(四、常见算法)
- Promotion hung up! The leader said it wasn't my poor skills
- Solution of QT TCP packet sticking
猜你喜欢
04. Project blog log
The digital economy has broken through the waves. Is Ltd a Web3.0 website with independent rights and interests?
自建DNS服务器,客户端打开网页慢,解决办法
[force buckle]43 String multiplication
ArcGIS application foundation 4 thematic map making
Installation de la Bibliothèque de processus PDK - csmc
SequoiaDB湖仓一体分布式数据库2022.6月刊
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
PDK工藝庫安裝-CSMC
初识CDN
随机推荐
03. 开发博客项目之登录
【华为机试真题详解】统计射击比赛成绩
First acquaintance with CDN
Station B Liu Erden linear regression pytoch
进程和线程
类和对象(一)this指针详解
【经验】win11上安装visio
[cloud native] 3.1 kubernetes platform installation kubespher
[experience] install Visio on win11
Redis消息队列
B站刘二大人-反向传播
Vulhub vulnerability recurrence 72_ uWSGI
What is independent IP and how about independent IP host?
C Advanced - data storage (Part 1)
剑指 Offer II 039. 直方图最大矩形面积
PDK process library installation -csmc
B站刘二大人-数据集及数据加载 Lecture 8
Check the useful photo lossless magnification software on Apple computer
What impact will frequent job hopping have on your career?
Installation de la Bibliothèque de processus PDK - csmc