Submission

Status:

----------

Subtask/Task Score:

0/100

Score: 0

User: Max

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 16:31:52

#include <iostream>
#include <string>
using namespace std;

int main(){
    int a, b, x, product, len;
    string str_product;
    cout << "A = ";
    cin >> a;
    cout << "B = ";
    cin >> b;
    cout << "x = ";
    cin >> x;
    product = a * b;
    str_product = to_string(product);
    len = str_product.length();
    if (x-1 < len)
        cout << str_product[x-1] << endl;
    else    
        cout << "_" << endl;
}