Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: 666whynot
Problemset: เลขหลักของผลคูณ
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-05 21:01:10
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);cin.tie(nullptr);
int a,b;cin>>a>>b;
long long sum = a*b;
int x;cin>>x;
int cnt = 0;
while(sum > 0){
sum /= 10;
cnt++;
}
sum = a*b;
vector<long long> s;
for(int i=1;i<=cnt;i++){
int e = sum % 10;
s.push_back(e);
sum /= 10;
}
int q = 0;
x--;
bool qwe;
reverse(s.begin(),s.end());
for(auto e:s){
qwe = false;
if(q == x){cout << e;break;}
else q++;qwe = true;
}
if(qwe)cout << '_';
}