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:41:03
#include<bits/stdc++.h>
using namespace std;
int 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=0; i<size-1; i++){
if(i == x-1){
ans = s[i] - '0';
break;
}
}
if(sum == 0 && x == 0){
cout<<"0"<<'\n';
return 0;
}
if(ans == -1){
cout<<"-"<<'\n';
}
else{
cout<<ans<<'\n';
}
return 0;
}