Advertisement
HabKaffee

Untitled

Sep 30th, 2021
679
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <fstream>
  2. #include <iostream>
  3. #include <vector>
  4.  
  5. int main() {
  6.     int n = 0, m = 0;
  7.     std::ifstream inputFile("C:/Users/nekna/CLionProjects/untitled2/input.txt");
  8.     inputFile >> n >> m;
  9.     std::vector<std::vector<char>> field(n, std::vector<char>(m, 0));
  10.     for (int i = 0; i < n; ++i) {
  11.         for (int j = 0; j < m; ++j) {
  12.             inputFile >> field[i][j];
  13.         }
  14.     }
  15.     //  Вывод того, что считали
  16.     for (size_t i = 0; i < n; ++i) {
  17.         for (size_t j = 0; j < m; ++j) {
  18.             std::cout << field[i][j] << " ";
  19.         }
  20.         std::cout << std::endl;
  21.     }
  22.     std::vector<int> startPos, finishPos;
  23.     for (size_t i = 0; i < 2; ++i) {
  24.         int tmp = -1;
  25.         inputFile >> tmp;
  26.         startPos.push_back(tmp);
  27.     }
  28.     for (size_t i = 0; i < 2; ++i) {
  29.         int tmp = -1;
  30.         inputFile >> tmp;
  31.         finishPos.push_back(tmp);
  32.     }
  33.     return 0;
  34. }
Advertisement
RAW Paste Data Copied
Advertisement