Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Nitro_Legacy
Problemset: เลขหลักของผลคูณ
Language: c
Time: 0.003 second
Submitted On: 2026-09-24 21:48:02
#include <stdio.h>
int main(){
int a, b, x;
scanf("%d %d %d", &a, &b, &x);
int prod = a * b;
int temp = prod;
int cnt = 0;
while (temp > 0){
temp /= 10;
cnt++;
}
if (x < 1 || x > cnt){
printf("_");
return 0;
} else {
for (int i = 1; i <= cnt - x; i++) {
prod /= 10;
}
}
printf("%d", prod % 10);
return 0;
}