Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <locale.h>
- #include <conio.h>
- #include <stdlib.h>
- int _tmain(int argc, _TCHAR* argv[])
- {
- setlocale(LC_ALL,"Russian");
- int j,i,n,m;
- double **mas;
- do
- {
- printf("введите размерность матрицы:");
- scanf("%d",&n);
- mas=(double**)calloc(n,sizeof(double*));
- for(i=0;i<n;i++)
- {
- mas[i]=(double*)calloc(n,sizeof(double));
- }
- printf("Введите элементы матрицы mas[i][j]\n");
- for(i=0;i<n;i++)
- {
- for(j=0;j<n;j++)
- {
- printf("Введите элементы матрицы mas[%d][%d]:",i,j);
- scanf("%lf",&mas[i][j]);
- }
- }
- printf("\nполучена матрица ",n);
- for(i=0;i<n;i++)
- {
- for(j=0;j<n;j++)
- {
- printf("%5.3f\t",mas[i][j]);
- }}
- m=n*(n+1)/2;
- printf("\nУпакованный вектор:%d");
- scanf("%d",&m);
- for(i=0;i<m;i++)
- {
- for(j=i;j<m;j++)
- {
- printf("%d",&m);
- }
- }
- _getch();
- return 0;
- } while(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement