输入10个数字,然后逆序输出。

输入   

1 2 3 4 5 6 7 8 9 0

输出

0 9 8 7 6 5 4 3 2 1
#include 
using namespace std;

int main()
{
	int a[10];
	for (int i = 0; i < 10; i++)
	{
		cin >> a[i];
	}
	for (int j = 9; j >= 0; j--)
	{
		cout << a[j] << ' ';
	}
	cout << endl;
	return 0;
}

你可能感兴趣的:(Python,数字反转,数组,循环,字符输出)