Skip to content

Instantly share code, notes, and snippets.

@jschementi
Created July 2, 2009 09:52
Show Gist options
  • Save jschementi/139405 to your computer and use it in GitHub Desktop.
Save jschementi/139405 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
namespace Demo {
public class Calculator {
private List<int>args = new List<int>();
public void Push(int n) {
args.Add(n);
}
public int Add() {
int result = 0;
foreach(int n in args) {
result += n;
}
return result;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment