Submission

Status:

----------

Subtask/Task Score:

0/100

Score: 0

User: fienicl

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-06 12:49:43

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

int main(){
	int a,b,x,n;
	cout << "A = "; cin >> a;
	cout << "B = "; cin >> b;
	cout << "x = "; cin >> x;
	n = a*b;
//	cout << n << "\n";
	int count = 0;
	vector <int> d(0);
	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){
		cout << "-";
	}
	else{
		cout << d[x-1];
	}
	return 0;
}