Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: kimza

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-09 07:36:14

#include <iostream>
using namespace std;

int main() {
    int a,b;
    cin >> a >> b;
    int x = a*b;
    int n;
    cin >> n;
    int digit;
    int digits = 0;
    int y = x;
    int it = 0;

    while(x>0){
        digit = x%10;
        digits++;
        x/=10;
    }
    if(n>digits){
        cout << "_";
    }
    else{
        for(int i = 0;i<(digits-n)+1;i++){
            digit = y%10;
            y/=10;
        }    
        cout << digit;
    }
    
    
    return 0;
}