Day 5-8 submissions
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct Note
|
||||
{
|
||||
string patterns[10];
|
||||
string outputs[4];
|
||||
|
||||
friend istream &operator>>( istream &input, Note &n ) {
|
||||
for(int i = 0; i < 10; i++)
|
||||
{
|
||||
input >> n.patterns[i];
|
||||
}
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
input >> n.outputs[i];
|
||||
}
|
||||
return input;
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
Note note;
|
||||
int count = 0;
|
||||
while (cin >> note)
|
||||
{
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
switch(note.outputs[i].size())
|
||||
{
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 7:
|
||||
count++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cout << count << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user