Added older advents
This commit is contained in:
parent
8db2505049
commit
9cf858b860
78 changed files with 13807 additions and 0 deletions
18
advent_of_code_2015/day1/main1.cc
Normal file
18
advent_of_code_2015/day1/main1.cc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
string buffer;
|
||||
|
||||
while(getline(cin, buffer))
|
||||
{
|
||||
int up = count(buffer.begin(), buffer.end(), '(');
|
||||
int down = count(buffer.begin(), buffer.end(), ')');
|
||||
|
||||
cout << "Floor: " << up - down << "\n";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue