Using only the function pow() of the cmath library, how can I do that?
this is what I've done so far and it is not working with me. What am I doing wrong?
int main()
{
long long n;
cin >> n;
if(n > 1000 || n < -1000){
for(int i = n, time = 1; i!=0; i/=10, time++){
int first = i;
while(first >= 10){
first /= 10;
}
cout << first;
if(time%3 == 0){
cout <<',';
}
}
}
else{
cout << n;
}
return 0;
}