Submission
Status:
PPPPP-PPP-
Subtask/Task Score:
80/100
Score: 80
User: s
Problemset: เลขหลักของผลคูณ
Language: cpp
Time: 0.003 second
Submitted On: 2025-09-23 14:19:14
#include<iostream>
#include<string>
using namespace std ;
int main() {
int a,b,x ;
cin >> a >> b >> x ;
string c=to_string(a*b) ;
if(x>c.length()) {
cout << "_" ;
} else if(x>2) {
string d=c.substr(x-1, x-2) ;
cout << d ;
} else if(x==2) {
string d=c.substr(1, 1) ;
cout << d ;
} else {
string d=c.substr(0, 1) ;
cout << d ;
}
}