Untitled

 avatar
user_7248805
plain_text
2 years ago
460 B
5
Indexable
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	int a, d, z = 0, x = 10, c = 0;
	cin >> a;
	d = a;
	while (d > 0) 
	{
		d /= 10;
		z++;
	}
	if (z < 5) 
	{
		for (int i = 0; z < 5; z++) 
		{
			cout << 0;
		}
		cout << a;
	}
	else if (z > 5) 
	{
		for (int i = 0; z > 5; z--) 
		{
			a /= 10;
		}
		cout << a;
	}
	else 
	{
		for (int i = 0; i < 5; i++) 
		{
			c = a / 10;
			cout << c;
		}
	
	}
}
Editor is loading...