#include <stdio.h>
char stack[1000]= {};
int top=-1;
void push(char a)
{
stack[++top]=a;
}
char pop()
{
return stack[top--];
}
int main()
{
int i,x,cnt=0;
char a[201];
scanf("%d %s",&x,a);
for(i=x-1; i>=0; i--)
{
push(a[i]);
cnt++;
if(cnt==3&&i>0)
{
push(',');
cnt=0;
}
}
while(top!=-1)
{
printf("%c",pop());
}
}
_________________________________________________________________
#include <stdio.h>
int stack [100000];
int top=-1;
void push(int a)
{
stack[++top]=a;
}
int pop()
{
return stack[top--];
}
int main()
{
int k,i,a,b,sum=0;
scanf("%d",&a);
for(i=1;i<=a;i++)
{
scanf("%d",&b);
if(b==0)
{
pop();
}
else
{
push(b);
}
}
while(top!=-1)
{
sum+=pop();
}
printf("%d",sum);
}
#include <stdio.h>
#include <string.h>
int top=-1;
int main()
{
int i,sum=0;
char arr[100000];
scanf("%s",arr);
for(i=0;arr[i]!=NULL;i++)
{
if(arr[i]=='('&&arr[i+1]==')')
{
//๋ ์ด์ ์ฝ๋
}
}
for(i=0;arr[i]!=NULL;i++)
{
if(//์ ๋ง๋๊ธฐ ๊ธธ์ด ์ฝ๋)
{
//์ ๋ง๋๊ธฐ ์ฝ๋
}
}
printf("%d",sum);
}



