Submission
Status:
PPPPPPP-PP
Score: 90
User: tankunkid
Problemset: เลขหลักของผลคูณ
Language: c
Time: 0.001 second
Submitted On: 2024-10-16 21:32:57
#include <stdio.h>
int main(void) {
int a, b, x;
scanf("%d %d %d", &a, &b, &x);
int product = a*b;
int num = 1;
for (int i = 1; i <= x; i++)
num *= 10;
if (product > num || product == 0)
{
while (product > num)
product /= 10;
printf("%d", product % 10);
}
else
{
printf("_");
}
}