当前位置:网站首页>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;
}
边栏推荐
- Jvxetable用slot植入j-popup
- C Advanced - data storage (Part 1)
- 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
- Pay attention to the details of pytoch code, and it is easy to make mistakes
- Installation de la Bibliothèque de processus PDK - csmc
- 数字经济破浪而来 ,LTD是权益独立的Web3.0网站?
- Check the useful photo lossless magnification software on Apple computer
- Application Security Series 37: log injection
- 【华为机试真题详解】检查是否存在满足条件的数字组合
- 29io stream, byte output stream continue write line feed
猜你喜欢

Graduation design game mall

C Advanced - data storage (Part 1)

【云原生】3.1 Kubernetes平台安装KubeSpher

JS array list actual use summary

Garbage collector with serial, throughput priority and response time priority

29io stream, byte output stream continue write line feed

毕业设计游戏商城

What is independent IP and how about independent IP host?

27io stream, byte output stream, OutputStream writes data to file

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
随机推荐
B站刘二大人-多元逻辑回归 Lecture 7
Check the useful photo lossless magnification software on Apple computer
Application Security Series 37: log injection
[experience] when ultralso makes a startup disk, there is an error: the disk / image capacity is too small
[machine learning notes] univariate linear regression principle, formula and code implementation
02. 开发博客项目之数据存储
改善Jpopup以实现动态控制disable
Huawei od computer test question 2
UCF (2022 summer team competition I)
Auto.js学习笔记17:基础监听事件和UI简单的点击事件操作
Codeless June event 2022 codeless Explorer conference will be held soon; AI enhanced codeless tool launched
Vulhub vulnerability recurrence 72_ uWSGI
Node 之 nvm 下载、安装、使用,以及node 、nrm 的相关使用
Easy to understand IIC protocol explanation
Selective parameters in MATLAB functions
Promotion hung up! The leader said it wasn't my poor skills
【SQL server速成之路】——身份验证及建立和管理用户账户
HAC集群修改管理员用户密码
Unity gets the width and height of Sprite
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