Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <string.h>
- #include <math.h>
- #include <stdlib.h>
- #define ROZMIAR 5
- int main()
- {
- int a[5];
- double x[ROZMIAR];
- int ile = 0;
- printf("Podaj z ilu elementow ma skladac sie tablica b: \n");
- scanf("%d", &ile);
- int b[ile];
- int i,j,k;
- for(i = 0; i < 5 ; i++)
- {
- printf("Podaj %d element tablicy 'a': \n", i);
- scanf("%d", &a[i]);
- }
- for(j = 0 ; j < ROZMIAR ; j++)
- {
- printf("Podaj %d element tablicy 'x': \n", j);
- scanf("%lf", &x[j]);
- }
- for( k = 0 ; k < ile ; k++)
- {
- printf("Podaj %d element tablicy 'b': \n", k);
- scanf("%d", &b[k]);
- }
- for(i = 0; i < 5 ; i++)
- printf("%d element tablicy 'a' to: %d \n", i, a[i]);
- for(j = 0; j < ROZMIAR ; j++)
- printf("%d element tablicy 'x' to: %lf \n", j, x[j]);
- for(k = 0; k < ile ; k++)
- printf("%d element tablicy 'b' to: %d \n", i, b[k]);
- printf("\n\n\n***TABLICA 'A' W ODWROTNEJ KOLEJNOSCI***\n\n");
- for(i = 4 ; i >= 0; i--)
- {
- printf("%d element tablicy 'a' to %d\n", i, a[i]);
- }
- int pom = 0, l = 0;
- kcheck:;
- printf("Podaj dolna granice przedzialu z ktorego mam wypisac liczby: \n");
- scanf("%d", &pom);
- printf("Podaj gorna granice: \n");
- scanf("%d", &l);
- if( pom < 0 || l < 0 || l > ROZMIAR - 1)
- {
- printf("Podales ujemny przedzial! 404! \n ");
- goto kcheck;
- }
- else
- for(j = pom ; j < l ; j++)
- {
- printf("%lf \n" ,x[j]);
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment