Submission

Status:

PP--PPPP-P

Subtask/Task Score:

70/100

Score: 70

User: opjns

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 11:10:43

#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++;
    }
    for(int i =0;i<len-x;i++) {
        product /= 10; 
    }
    digit = product%10;
    cout << digit;
    return 0;
}