Skip to content

Commit

Permalink
[crane] add srm_165_div2_250
Browse files Browse the repository at this point in the history
  • Loading branch information
Brown Crane committed Jun 1, 2012
1 parent b9cdd7d commit 71c099b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions srm_165_div2_250.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <vector>
using namespace std;

class BritishCoins{
public:
vector <int> coins(int pence){
vector<int> num;
num.clear();
int pound = pence / 240;
num.push_back(pound);
int shilling = (pence / 12) - pound * 20;
num.push_back(shilling);
int penny = pence - pound * 240 - shilling * 12;
num.push_back(penny);
return num;
}
};

0 comments on commit 71c099b

Please sign in to comment.