您怎么知道您是正确的呢?
by 桐间纱路 @ 2018-10-27 18:52:03
您怎么知道您是正确的呢?
by Lhc_fl @ 2018-10-27 18:54:26
```
#include<bits/stdc++.h>
using namespace std;
int i=1,a[100];
int main()
{
do
{
i++;
cin>>a[i];
}while(a[i]!=0);
for(int /*n=i-1*/n=i-2;n>=1;n--)
cout<<a[n]<<" ";
return 0;
}
```
by blue_bird @ 2018-10-27 18:55:49
@[顾里](/space/show?uid=140043) 您这把0都输出来了啦,请注意看题好吧,输出样例里没有输出0哦
```cpp
for(int n=i-1;n>=1;n--)
cout<<a[n]<<" ";
```
改为
```cpp
for(int n=i-1;n>1;n--)
cout<<a[n]<<" ";
```
就会完美AC啦
by TianZ @ 2018-10-27 18:56:01
@[顾里](/space/show?uid=140043) 你是怎么看出运行结果全正确的???
by 土田共戈 @ 2018-10-27 18:56:38
@[blue_bird](/space/show?uid=84730) 您这好像也不太对啊,您的输出结果是
>1 34 5 23 65 3 0
by TianZ @ 2018-10-27 18:58:09
#include<bits/stdc++.h>
using namespace std;
int i=1,a[100];
int main()
{
do
{
i++;
cin>>a[i];
}while(a[i]!=0);
for(int n=i-1;n>=2;n--)
cout<<a[n]<<" ";
return 0;
}
```
尴尬.png
by blue_bird @ 2018-10-27 18:58:20
QAQ...
by blue_bird @ 2018-10-27 18:59:59
```cpp
#include<bits/stdc++.h>
using namespace std;
int i=1,a[100];
int main()
{
do
{
i++;
cin>>a[i];
}while(a[i]!=0);
for(int n=i-1;n>=2;n--)
cout<<a[n]<<" ";
return 0;
}
```
by blue_bird @ 2018-10-27 19:01:06
@[天真、陈长生](/space/show?uid=67212) 谢谢大佬
by 顾里 @ 2018-10-27 19:02:15