Submission

Status:

PP--PPPP-P

Subtask/Task Score:

70/100

Score: 70

User: Dark_kingdom

Problemset: เลขหลักของผลคูณ

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-08 00:38:07

#include <iostream>
#include <string>
#include <sstream>
#include <cmath> 

using namespace std;

int main()
{

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int A, B;
	if (!(cin >> A >> B)) return 0;
	

	long long result = (long long)A * B; 
	if (result < 0) {
		result = abs(result); 
	}
	

	stringstream ss;
	ss << result;
	string c = ss.str(); 
	
	int x;
	if (!(cin >> x)) return 0;
	

	int index = x - 1; 
	

	if (index < 0 || index >= c.length())
	{
		cout << "-"; 
		return 0;
	}
	

	if (c[index] == ' ')
	{
		cout << "-";
	}
	else
	{
		cout << c[index];
	}
	
	return 0;
}