Advertisement
Guest User

Untitled

a guest
May 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <malloc.h>
  4. #include <iostream>
  5.  
  6. int main(){
  7. FILE *input = fopen("C:\\Users\\Miron\\Desktop\\input.txt", "rb");
  8. int n;
  9. double *B = (double *)malloc(n*sizeof(double));
  10. fscanf(input,"%d",&n);
  11. double **A = (double **)malloc(n*sizeof(double *));
  12. for(int i = 0; i < n; i++){
  13. A[i] = (double *)malloc(n*sizeof(double));
  14. }
  15.  
  16.  
  17. for (int i = 0; i < n; i++) {
  18. for (int j = 0; j < n; j++) {
  19. fscanf(input, "%lf", &A[i][j]);
  20. printf("%lf ", A[i][j]);
  21. }
  22. fscanf(input, "%lf", &B[i]);
  23. printf("\n");
  24. }
  25.  
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement