From 13dd7bc15b2c3ac74113b30b311bbfef4c74b090 Mon Sep 17 00:00:00 2001 From: Davide Pollicino Date: Sun, 25 Oct 2020 15:51:55 +0000 Subject: [PATCH] Update reverse_the_number.cpp --- codechef/reverse_the_number.cpp | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/codechef/reverse_the_number.cpp b/codechef/reverse_the_number.cpp index e69de29..b16be92 100644 --- a/codechef/reverse_the_number.cpp +++ b/codechef/reverse_the_number.cpp @@ -0,0 +1,44 @@ +// https://www.codechef.com/problems/FLOW007// SOLUTION NOT READY +#include +#include +using namespace std; + +void reverse_string() +{ + string number; + cin >> number; + int start_point = number.size()-1; + // If the last numebr is 0 + if(number[number.size()-1] =='0') + { + for(int i = number.size()-1; i>=0; i--) + { + if(number[i] != number[i-1]) + { + start_point = i-1; + break; + } + + } + } + + for(int i=start_point; i>=0; i--) + { + cout<>t; + for(int i =0; i