View Code of Problem 54

#include<iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
using namespace std;
#pragma warning(disable:4996)


int main() {
	int n;
	scanf("%d", &n);
	int s[100];
	int i;
	for (i = 0;; i++) {
		s[i] = n % 10;
		if (n==n%10)
			break;
		n = n / 10;
	}
	for (int j = 0;j<i+1; j++) {
		printf("%d", s[i - j]);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 54