Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
250 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
	float a;
	int i = -1;
	cin >> a;
	while (a)
	{
		if (a - int(a) > 0) i++;
		a *= 10;
		if (a - int(a) == 0) break;
	}
	while (i)
	{
		a /= 10;
		i--;
	}
	cout << int(a)%10;
}
Leave a Comment