Submission

Status:

----------

Subtask/Task Score:

0/100

Score: 0

User: Punnavich

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-01 09:26:40

#include <bits/stdc++.h>

using namespace std;

int main(){
    int a,b;
    cout<<"A = ";
    cin>>a;
    cout<<"B =";
    cin>>b;
    int x;
    cout<<"x =";
    cin>>x;
    int c;
    c = a*b;
    string str = to_string(c);
    if (x >= 1 && x <= str.length()) {
        cout << str[x - 1];
    } else {
        cout << "-";
    }
}