Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Reverse The Number codechef solution in c++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
	int t, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		string s = to_string(n);
		reverse(s.begin(), s.end());
		while (s.at(0) == '0')
		{
			s.erase(s.begin());
		}
		cout << s;
		cout << "
";
	}
	return 0;
}
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #Reverse #The #Number #codechef #solution
ADD COMMENT
Topic
Name
8+1 =