Submission

Status:

PP--PPPP-P

Subtask/Task Score:

70/100

Score: 70

User: Mano

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-02 21:43:56

#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int main(){
	int a,b,x,sum,y,c=0;
	cin>>a>>b>>x;
	sum=a*b;
	string s;
	s=to_string(sum);
	y=s.length();
	if(x>y){
		cout<<"-";
	}
	else{
		if((a*b)<0){
			cout<<s[x]-'0';
		}
		else{
			cout<<s[x-1]-'0';
		}
	}
	return 0;
}