Advertisement
Sdager54

Untitled

Nov 28th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <sstream>
  5. using namespace std;
  6.  
  7.  
  8. void read_file(){
  9. ifstream fin("INPUT.txt");
  10. string N;
  11. int N_int;
  12. getline(fin, N);
  13. N_int = atoi(N.c_str());
  14. int** int_mas2 = new int*[N_int + 1, N_int + 1];
  15. string* string_mas1 = new string[N_int+1];
  16. for (int j = 0; j < N_int; j++){
  17. getline(fin, string_mas1[j]);
  18. for (int i = 0; i < N_int; i++){
  19. int_mas2[i][j] = atoi(string_mas1[i].c_str());
  20. cout << int_mas2[i][j] << " ";
  21. }
  22. //cout << string_mas1[j] << endl;
  23. }
  24. fin.close();
  25.  
  26. }
  27.  
  28.  
  29.  
  30. void main(){
  31. read_file();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement