Submission

Status:

------P--P

Subtask/Task Score:

20/100

Score: 20

User: opjns

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

Language: cpp

Time: 0.002 second

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

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