Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int n = 0;
- int k = 0;
- printf("Ile zbiorow ma znajdowac sie w tablicy?\n");
- scanf("%d", &n);
- printf("Ile liczb ma znajdowac sie w kazdym zbiorze?\n");
- scanf("%d", &k);
- // tab[n][k]
- double **tab, **pom;
- tab = (double**)malloc(n*sizeof(double**));
- for(int i=0; i<n; i++){
- tab[i]=(double*)malloc(k*sizeof(double*));
- }
- pom = tab;
- int l = 1;
- tab = pom;
- for(int j = 0; j<n; j++){
- printf("Wpisz liczby do zbioru %d:\n", l++);
- for(int h = 0; h<k; h++){
- scanf("%lf", tab);
- tab++;
- }
- }
- l = 1;
- tab = pom;
- printf("Zawartosc tablicy %d x %d:\nZbior:\n", n, k);
- for(int g = 0; g<n; g++){
- printf("%d\t\t", l++);
- for(int f = 0; f<=k; f++){
- if(f==k) {
- printf("\n");
- tab++;
- }
- else {
- printf("%lf\t\t", *tab);
- tab++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement