Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- char el;
- vector<vector<int>> matrix;
- for (int i = 0; i < n; i++) {
- vector<int> currentRow;
- for (int j = 0; j < n; j++) {
- cin >> el;
- currentRow.push_back(el);
- }
- matrix.push_back(currentRow);
- }
- char symbol;
- cin >> symbol;
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- if (matrix[i][j] == symbol) {
- printf("(%i, %i)\n", i, j);
- return 0;
- }
- }
- }
- printf("%c does not occur in the matrix\n", symbol);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement