Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int i=0,dlugosc;
- char *tablica,tmp;
- printf("podaj dlugosc tablicy: ");
- fscanf_s(stdin,"%c",&dlugosc);
- tablica = (double*) calloc(dlugosc, sizeof(char));
- printf("wczytaj tablice:\n");
- for(i=0;i<dlugosc;i++)
- {
- fflush(stdin);
- fscanf_s(stdin,"%c",&tablica[i]);
- }
- for(i=0;i<dlugosc;i++)
- printf("%c",tablica[i]);
- for(i=0;i<dlugosc/2;i++)
- {
- tmp=tablica[i];
- tablica[i]=tablica[dlugosc-i-1];
- tablica[dlugosc-i-1]=tmp;
- }
- printf("\nzawartosc tablicy:\n");
- for(i=0;i<dlugosc;i++)
- printf("%c",tablica[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement