将任意的数倒叙输出

 
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	string input;	
	cin>>input;	
	int i=input.length()-1;	
	while(i!=-1)
	{		
		cout<<input[i];
		--i;		
	}
	return 0;
}

  

  

posted @ 2013-08-02 00:53  一桶白开水  阅读(235)  评论(0编辑  收藏  举报