Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int row, col, num;
- cin >> row >> col;
- vector<vector<int>> matrix;
- for (int i = 0; i < row; i++) {
- vector<int> currentRow;
- for (int j = 0; j < col; j++) {
- cin >> num;
- currentRow.push_back(num);
- }
- matrix.push_back(currentRow);
- }
- cin >> num;
- bool isfound = false;
- for (int i = 0; i < row; i++) {
- for (int j = 0; j < col; j++) {
- if (matrix[i][j] == num) {
- cout << i << ' ' << j << endl;
- isfound = true;
- }
- }
- }
- if (!isfound) {
- cout << "not found" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement