Submission

Status:

PPxxPPPPxP

Subtask/Task Score:

70/100

Score: 70

User: Sunsblad

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-09-30 18:39:08

#include<iostream>
#include<stack>
using namespace std;
int main(){
    long long int a,b,x;
    stack<int> l;
    cin>>a>>b>>x;
    a *= b;
    while(a > 0){
        l.push(a%10);
        a /= 10;
    }
    for(int i = 0; i<x; i++){
        if(i == x-1){
            cout<<l.top();
            return 0;
        }else{
            l.pop();
        }
    }
    cout<<'-';
    return 0;

}