| 36 | } |
| 37 | |
| 38 | int main() |
| 39 | { |
| 40 | ofstream fout(getenv("OUTPUT_PATH")); |
| 41 | |
| 42 | string n_temp; |
| 43 | getline(cin, n_temp); |
| 44 | |
| 45 | int n = stoi(ltrim(rtrim(n_temp))); |
| 46 | //initialize the array |
| 47 | vector<vector<int>> arr(n); |
| 48 | |
| 49 | for (int i = 0; i < n; i++) { |
| 50 | arr[i].resize(n); |
| 51 | |
| 52 | string arr_row_temp_temp; |
| 53 | getline(cin, arr_row_temp_temp); |
| 54 | |
| 55 | vector<string> arr_row_temp = split(rtrim(arr_row_temp_temp)); |
| 56 | |
| 57 | for (int j = 0; j < n; j++) { |
| 58 | int arr_row_item = stoi(arr_row_temp[j]); |
| 59 | |
| 60 | arr[i][j] = arr_row_item; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | int result = diagonalDifference(arr,n); |
| 65 | |
| 66 | fout << result << "\n"; |
| 67 | |
| 68 | fout.close(); |
| 69 | |
| 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | string ltrim(const string &str) { |
| 74 | string s(str); |
nothing calls this directly
no test coverage detected