Submission

Status:

------P--P

Subtask/Task Score:

20/100

Score: 20

User: fienicl

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

Language: cpp

Time: 0.003 second

Submitted On: 2026-10-06 13:18:14

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	int a,b,x,n;
	cin >> a >> b >> x;
	if(x<0){
		return 0;
	}
	n = a*b;
//	cout << n << "\n";
	int count = 0;
	vector <int> d;
	char t[count];
	while(n>0){
//		cout << n%10 << " ";
		d.push_back (n%10);
//		cout << d[count] << " ";
		n/=10;
//		cout << n << " ";
		++count;
//		cout << count << " ";
	}
	reverse(d.begin(), d.end());
//	for(int i = 0; i < d.size(); ++i){
//		cout << d[i] << "\n";
//	}
	if(x-1 > count || x <= 0){
		cout << "-";
	}
	else{
		cout << d[x];
	}
	return 0;
}