Submission

Status:

PPPPPPP-PP

Subtask/Task Score:

90/100

Score: 90

User: indy

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-09-30 15:14:03

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

int main() {
    int a,b,sum,x,length;
    string sum_str;
    //cout<<"A = ";
    cin>>a;
    //cout<<"B = ";
    cin>>b;
    //cout<<"x = ";
    cin>>x;

    sum = a*b;
    sum_str = to_string(sum);
    length = to_string(sum).length();
    if (x<length && x>0){
        cout<<sum_str[x-1];
    }else{
        cout<<"_";
    }

}