Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Trin1506

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-09 18:25:06

#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b,x,cnt=0;
    cin >> a >> b >> x;
    int p = a*b;
    int arr[12];
    for(int i=0;i<12;i++){
        arr[i] = -1;
    }
    while(p>0){
        arr[cnt] = p%10;
        p/=10;
        cnt++;

    }
    if(arr[cnt -x]==-1||cnt-x<0)cout << '_';
    else if (x>12)cout << "_";
    else cout<< arr[cnt-x];
}