Search
 
SCRIPT & CODE EXAMPLE
 

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: prompt user for bool statement C++ 
Cpp :: adding two dates using necessary member function in c++ 
Cpp :: apertura file in c++ 
Cpp :: forkortelse for intet 
Cpp :: ++m in c 
Cpp :: how to seek to the start of afile in c++ 
Cpp :: print float up to 3 decimal places in c++ 
Cpp :: how to create a custom event in ue4 c++ 
Cpp :: long, long long 32 bit or 8 bit in c++ 
Cpp :: cout alternative c++ 
Cpp :: viewlist exaple win32 
Cpp :: turn it codechef solution in c++ 
Cpp :: c++ require keyword 
Cpp :: sinh nhi phan c++ 
Cpp :: how to print out a two dimensional array in c++ 
Cpp :: cin une énumération 
Cpp :: comment installer boost c++ sur windows 
Cpp :: formated string std::cout 
Cpp :: how to get max grade c++ 
Cpp :: numpy array scalar addition 
Cpp :: delete an dynamic array 
Cpp :: operator overloading prefix postfix c++ 
Cpp :: Implement a currency converter which ask the user to enter value in Pak Rupees and convert in following: in cpp 
Cpp :: erase in c++ 
Cpp :: draw point sfml 
Cpp :: catalan numbers c++ 
Cpp :: c + + to c converter 
Cpp :: niet werkend 
Cpp :: & before function arg in cpp 
Cpp :: Code Example of Switch Statement in C++/Java 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =