Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define ROZMIAR 50
- char c;
- int i, j, n, a;
- void clear (void)
- {
- while ( getchar() != '\n' );
- }
- int main(void){
- printf("Podaj ile stringow chcesz posortowac: ");
- scanf("%d", &n);
- char tab[n][ROZMIAR];
- int pom[n];
- for (i=0; i<n; i++){
- j=0;
- if (i==0) clear();
- printf("Podaj %d. string: ", i+1);
- for(;(c=getchar())!=EOF && c!='\n' && j<ROZMIAR;j++){
- tab[i][j]=c;
- }
- pom[i]=j;
- }
- for (i=0; i<n; i++){
- for (j=0; j<pom[i]; j++){
- printf("%c", tab[i][j]);
- if (j==pom[i]-1) printf("\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement