#include<stdio.h>
#define SIZE 10
double stack[SIZE];
int sp;
void push(double value);
double pop(void);
int isFull(void);
int isEmpty(void);
void answer(void);
void reset(void);
int main(void)
{
reset();
int a,i;
double data;
while(1){
if (!a) break;
switch(a){
case 1:for(i=0;i<sp;i++)
data = data +stack[i];
push(data);break;
case 5:scanf("%f",&data
);printf("%f ",data
);push
(data
);break; case 9: a=0;break;
}
}
answer();
return 0;
}
void push(double value){
else stack[sp++] = value;}
double pop(void){
if(isEmpty
()){printf("空");return 0;} else return stack[--sp];
}
int isFull(void){
if (sp >=SIZE) return 1;
else return 0;
}
int isEmpty(void){
if(sp <= 0)return 1;
else return 0;
}
void answer(void){
}
void reset(void){
sp = 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KCiNkZWZpbmUgU0laRSAxMApkb3VibGUgc3RhY2tbU0laRV07CmludCBzcDsKCnZvaWQgcHVzaChkb3VibGUgdmFsdWUpOwpkb3VibGUgcG9wKHZvaWQpOwppbnQgaXNGdWxsKHZvaWQpOwppbnQgaXNFbXB0eSh2b2lkKTsKdm9pZCBhbnN3ZXIodm9pZCk7CnZvaWQgcmVzZXQodm9pZCk7CgppbnQgbWFpbih2b2lkKQp7CiAgICByZXNldCgpOwogICAgaW50IGEsaTsKICAgIGRvdWJsZSBkYXRhOwp3aGlsZSgxKXsKCXNjYW5mKCIlZCIsJmEpOwoJaWYgKCFhKSBicmVhazsKCXN3aXRjaChhKXsKCQljYXNlIDE6Zm9yKGk9MDtpPHNwO2krKykKCQkgICAgICAgZGF0YSA9IGRhdGEgK3N0YWNrW2ldOwoJCSAgICAgICBwdXNoKGRhdGEpO2JyZWFrOwoJCWNhc2UgNTpzY2FuZigiJWYiLCZkYXRhKTtwcmludGYoIiVmICIsZGF0YSk7cHVzaChkYXRhKTticmVhazsKCQljYXNlIDk6IGE9MDticmVhazsKCX0KCQoJCn0KCiAgICBhbnN3ZXIoKTsKCiAgICByZXR1cm4gMDsKfQp2b2lkIHB1c2goZG91YmxlIHZhbHV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