20250725
/*
#include <stdio.h>
int main()
{
int stack[100000] = {};
int top = 0;
int n,k,m = 0;
scanf("%d",&n);
k=n;
if(n/10==0)
{
printf("%d",n);
return 0;
}
while(1)
{
if(k/10==0)
{
stack[top]=k;
top++;
break;
}
stack[top]=k%10;
k=k/10;
top++;
m++;
}
top=0;
while(1)
{
if(top>m)
{
return 0;
}
printf("%d",stack[top]);
top++;
}
}
*/
#include <stdio.h>
int main()
{
int stack[100000] = {};
int top = 0;
int n,k,c,m,s; // n: 숫자의 길이,c: 숫자, m: 천단위 구분기호 콤마 여유분 계산, s: 숫자의 복제본.
scanf("%d %d",&n,&c);
s=c; // s 숫자 복제본 생성
printf("\n-----------------\n\n"); ////
while(1)
{
if(s/10==0)
{
stack[top]=s%10;
printf("%d",s%10); ////
printf("\n\n-----------------\n\n"); ////
break;
}
printf("%d",s%10); ////
stack[top]=s%10;
s=s/10;
top++;
}
m=n%3;
if(m!=3)
{
for(int i=0;i<m;i++)
{
printf("%d",stack[top]);
top++;
}
printf(",");
}
}




