Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Sense.exe

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-25 22:53:11

#include <bits/stdc++.h>
using namespace std;

int main() {
    int A,B,x;
    cin >> A >> B >> x;
    vector<char> v;
    string s = to_string(A*B);
    if(A<=100000&&B<=100000&&x<=100000) {
        for(auto x:s) {
            v.push_back(x);
        }
        if(v.size()-1>=x-1) { //ตอนแรก (v[x-1])!=string::npos ซึ่งผิด
            cout << (v[x-1]-'0');
        }
        else {
            cout << "_";
        }
    }
}