Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: opjns
Problemset: เลขหลักของผลคูณ
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-13 11:16:31
#include <iostream>
using namespace std;
int main () {
int a, b, x,digit,len=0;
long long product;
cin >> a;
cin >> b;
cin >> x;
product = a*b;
long long temp = product;
while(temp>0) {
temp /= 10;
len++;
}
if(x>len){
cout << "_";
return 0;
}
for(int i =0;i<=len-x;i++) {
digit = product%10;
product /= 10;
}
cout << digit;
return 0;
}