Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- char mask[10][3][3]=
- {
- {
- {' ','_',' '},
- {'|',' ','|'},
- {'|','_','|'}
- },
- {
- {' ',' ',' '},
- {' ',' ','|'},
- {' ',' ','|'}
- },
- {
- {' ','_',' '},
- {' ','_','|'},
- {'|','_',' '}
- },
- {
- {' ','_',' '},
- {' ','_','|'},
- {' ','_','|'}
- },
- {
- {' ',' ',' '},
- {'|','_','|'},
- {' ',' ','|'}
- },
- {
- {' ','_',' '},
- {'|','_',' '},
- {' ','_','|'}
- },
- {
- {' ','_',' '},
- {'|','_',' '},
- {'|','_','|'}
- },
- {
- {' ','_',' '},
- {' ',' ','|'},
- {' ',' ','|'}
- },
- {
- {' ','_',' '},
- {'|','_','|'},
- {'|','_','|'}
- },
- {
- {' ','_',' '},
- {'|','_','|'},
- {' ','_','|'}
- }
- };
- int acii_numbers(char input[3][3])
- {
- for (int i=0; i<=9;i++)
- if (input == mask[i])
- return i;
- }
- int main()
- {
- string first,second,third;
- getline(cin, first);
- getline(cin, second);
- getline(cin, third);
- for (int i=1; i <= first.length(); i++)
- if (i % 4 == 3)
- {
- char temp[3][3] = {
- {first[i-2],first[i-1],first[i]},
- {second[i-2],second[i-1],second[i]},
- {third[i-2],third[i-1],third[i]}
- };
- cout << acii_numbers(temp) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment