Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Sun999
Problemset: เลขหลักของผลคูณ
Language: cpp
Time: 0.005 second
Submitted On: 2026-10-08 21:52:01
#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;
}