# addmach1.py
# Written by Todd Wareham for CS 2500
"""
Implements interactive adding machine with these commands:

    "+ X"  : Add floating number X to sum
    "- X"  : Subtract floating number X from sum
    "="    : Print value of sum
    "stop" : Exit session

This version is implemented using the float numeric datatype.
"""

sum = 0.0
while True:
    line = raw_input()
    if (line.split()[0] == "+"):
        sum += float(line.split()[1])
    elif (line.split()[0] == "-"):
        sum -= float(line.split()[1])
    elif (line.split()[0] == "="):
        print sum
    elif (line.split()[0] == "stop"):
        break

