Advertisement
Guest User

Untitled

a guest
May 30th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <malloc.h>
  3.  
  4. int main(){
  5.  
  6. int j, i, n;
  7. float **vet;
  8.  
  9. scanf("%d", &n);
  10. vet = (float **)malloc(sizeof(float *)*n);
  11. for(i=0;i<n;i++)
  12. vet[i] = (float *)malloc(sizeof(float)*n);
  13. for(i=0;i<n;i++)
  14. scanf("%f", &vet[i][0]);
  15. for(i=0;i<n;i++){
  16. for(j=1;j<n;j++)
  17. vet[i][j] = vet[i][j-1]*vet[i][0];
  18. }
  19.  
  20. for(i=0;i<n;i++){
  21. for(j=0;j<n;j++){
  22. printf("%6.2f ", vet[i][j]);
  23. }
  24. printf("\n");
  25. }
  26. free(vet);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement