Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <malloc.h>
- int main(){
- int j, i, n;
- float **vet;
- scanf("%d", &n);
- vet = (float **)malloc(sizeof(float *)*n);
- for(i=0;i<n;i++)
- vet[i] = (float *)malloc(sizeof(float)*n);
- for(i=0;i<n;i++)
- scanf("%f", &vet[i][0]);
- for(i=0;i<n;i++){
- for(j=1;j<n;j++)
- vet[i][j] = vet[i][j-1]*vet[i][0];
- }
- for(i=0;i<n;i++){
- for(j=0;j<n;j++){
- printf("%6.2f ", vet[i][j]);
- }
- printf("\n");
- }
- free(vet);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement