Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Sunsblad

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-25 18:12:12

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int num = 0, num2 = 0, x = 0, len = 0, numa = 0;
    cin >> num >> num2 >> x;
    num = num * num2;
    numa = num;
    while(num>0)
    {
        num = num / 10;
        len += 1;
    }
    len = len - x;
    if(len<0)
    {
        cout << "_";
        return 0;
    }
    num2 = 1;
    for (int i = 0; i<len;i++)
    {
        num2 *= 10;
    }
    numa = numa / num2;
    cout << numa % 10;
}