Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // description
- #include <iostream>
- #include <string>
- void inputArrayString(int row, int col , std::string ar[row][col]);
- int main()
- {
- using namespace std;
- const int Row = 3;
- const int Col = 4;
- string list2[Row][Col];
- inputArrayString(Row, Col, list2);
- return 0;
- }
- void inputArrayString(int row, int col , std::string ar[row][col])
- {
- for (int r = 0; r < row; ++r)
- {
- for (int c = 0; c < col; ++c)
- getline(std::cin, ar[r][c]);
- std::cout << std::endl;
- }
- }
- int main(int argc, char* argv[])
- {
- int stroch;
- int stolb;
- cin>>stroch;
- cin>>stolb;
- int **mass = new int*[stroch];
- for(int i = 0;i<stroch;i++){
- mass[i]= new int[stolb];
- }
- for(int i = 0; i<stroch;i++){
- for(int j = 0; j<stolb;j++){
- mass[i][j] = rand()%21 - 10;
- }
- }
- for(int i = 0; i<stroch;i++){
- for(int j = 0; j<stolb;j++){
- cout<<mass[i][j]<<"t";
- }
- cout<<"n";
- }
- for(int i=0; i<stroch;i++){
- delete[] mass[i];
- }
- delete[] mass;
- getch();
- }
Add Comment
Please, Sign In to add comment