Submission

Status:

PP--PPP--P

Subtask/Task Score:

60/100

Score: 60

User: Sun999

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-08 21:50:32

#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int A,B,x;
	cin>>A>>B>>x;
	int sum = A*B;
	string s = to_string(sum);
	int size = s.length();
	int ans = -1;
	
	
		for(int i=1; i<size; i++){
			if(i == x){
				ans = s[i-1] - '0';
				break;
			}
		}
	
	if(sum == 0 && x == 0){
		cout<<"0"<<'\n';
		return 0;
	}
	if(ans == -1){
		cout<<"-"<<'\n';
	}
	else{
		cout<<ans<<'\n';
	}
	
	
	return 0;
}