Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <malloc.h>
- #include <iostream>
- int main(){
- FILE *input = fopen("C:\\Users\\Miron\\Desktop\\input.txt", "rb");
- int n;
- fscanf(input,"%d",&n);
- double **A = (double **)malloc(n*sizeof(double *));
- for(int i = 0; i < n; i++){
- A[i] = (double *)malloc(n*sizeof(double));
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- fscanf(input, "%lf", &A[i][j]);
- printf("%lf ", A[i][j]);
- }
- printf("\n");
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- printf("%lf \n", A[i][j]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement