/*
#include <stdio.h>
#include <string.h>
#define size 101
int stack[size+1]= {};
int top=-1;
void push(int data)
{
top++;
stack[top]=data;
}
int pop()
{
return stack[top--];
}
int main()
{
int i, c=0,lena,lenb,num=0;
char a[size],b[size];
scanf("%s %s", a,b);
lena=strlen(a)-1;
lenb=strlen(b)-1;
while(lena!=-1&&lenb!=-1)
{
num=(a[lena]+b[lenb]+c-96);
push(num%10);
c=num/10;
lena--;
lenb--;
}
if(lena<lenb)
{
while(lenb!=-1)
{
num=(b[lenb]+c-48);
push(num%10);
c=num/10;
lenb--;
}
}
else if(lena>lenb)
{
while(lena!=-1)
{
num=(a[lena]+c-48);
push(num%10);
c=num/10;
lena--;
}
}
if(c!=0) push(1);
while(top!=-1)
{
printf("%d",pop());
}
return 0;
}
2839287
12345678910111213
#include <stdio.h>
#include <string.h>
#define size 50001
int stack[size]= {};
int top=-1;
void push(int data)
{
top++;
stack[top]=data;
}
int pop()
{
return stack[top--];
}
int main()
{
char str[size]={};
int i;
scanf("%s",str);
for (i=0;i<strlen(str);i++)
{
if (str[i]=='(')
{
push (1);
}
else
{
if (top==-1)
{
printf("bad");
return 0;
}
pop();
}
}
if (top!=-1)
{
printf("bad");
}
else
{
printf("good");
}
return 0;
}
7
push( 567 )
top()
push( 7 )
push( 3333 )
top()
pop()
size()
*//*
#include <stdio.h>
#include <string.h>
#define size 201
int stack[size]={};
int top=-1;
void push(int data)
{
top++;
stack[top]=data;
}
int pop()
{
if (top==-1)
return 0;
return stack[top--];
}
int main()
{
char order[20];
int i,n,p=6,num;
scanf("%d ", &n);
for (i=0;i<n;i++)
{
gets(order);
if (order[0]=='p'&&order[1]=='u')
{
num=0;
p=6;
while (order[p]!=32)
{
num=num*10+order[p]-'0';
p++;
}
push(num);
}
else if (order[0]=='p'&&order[1]=='o')
{
pop();
}
else if (order[0]=='t')
{
if (top==-1)
{
printf("-1\n");
}
else
{
printf("%d\n", stack[top]);
}
}
else if (order[0]=='s')
{
printf("%d\n", top+1);
}
else if(order[0]=='e')
{
if (top==-1)
{
printf("true\n");
}
else
{
printf("false\n");
}
}
}
return 0;
}*/
#include <stdio.h>
#include <string.h>
#define size 201
int stack[size]={};
int top=-1;
void push(int data)
{
top++;
stack[top]=data;
}
int pop()
{
if (top==-1)
return 0;
return stack[top--];
}
int main()
{
char str[size]={};
int i,num=0;
gets(str);
for (i=1;i<strlen(str);i++)
{
if (str[i]==' ') continue;
else if (str[i]>=48&&str[i]<=57)
{
num=num*10+(str[i]-48);
if (str[i+1]==' ')
{
push(num);
}
}
else if (str[i]=='*')
{
}
else if (str[i]=='*')
{
}
else if (str[i]=='*')
{
}
else if (str[i]=='*')
{
}
}
}