Submission

Status:
PPPPPPPPPP

Score: 100

User: solarsunny

Problemset: เลขหลักของผลคูณ

Language: c

Time: 0.002 second

Submitted On: 2024-12-20 11:57:30

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>

int main() {
    int a;
    scanf("%d", &a);
    int b;
    scanf("%d", &b);
    int x;
    scanf("%d", &x);
    
    int c= a*b;

    int l=0;

    int t=c;
    while(t!=0) {
        l++;
        t = t / 10;
    }

    if(x>l) {
        printf("_ \n");
        return 0;
    }

    for(int i=0; i<(l-x); i++) {
        c = c/10;
    }
    
    int m = c % 10;

    printf("%d \n", m);
    return 0;
}