Graveldragon
ДАЮ 15 Поинтов. Нужно сделать так чтобы здесь вместо (cout) были только printf and scanf. #include #include #include #include #include using namespace std;int main(){setlocale(LC_ALL, "Ukr");const int n = 3, m = 3;printf("Кiлькiсть рядкiв матрицi = ");scanf_s("%d", &n);printf("Кiлькiсть стовпцiв матрицi = ");scanf_s("%d", &m);int mat[n][m];srand(time(NULL));printf("Була:n ");for (int i = 0; i < n; i++)for (int j = 0; j < m; j++)mat[i][j] = rand() % 21 - 10;for (int i = 0; i < n; i++){for (int j = 0; j < m; j++)cout << " " << mat[i][j];cout << endl;}printf("Cтала:n ");for (int i = 0; i < n; i++){int* temp = new int[n];temp[i] = mat[n - 1][i];mat[n - 1][i] = mat[i][0];mat[i][0] = temp[i];}for (int i = 0; i < n; i++){for (int j = 0; j < m; j++)cout << " " << mat[i][j];cout << endl;}return 0;}
ответы: 1
Зарегистрируйтесь, чтобы добавить ответ
Laura Martinez
Чтобы ответить необходимо зарегистрироваться.