Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdbool.h>
- unsigned long hash()
- {
- int p = 0;
- unsigned long g,h=0;
- for (;p != EOF;)
- {
- p = getchar();
- h = (h << 4) + p;
- g = (h & 0xF0000000);
- if (g) h = h^(g | (g >> 24));
- }
- return h % 104729 + 1;
- }
- void count(){
- int p = 0;
- unsigned long znaki = 0, linie = 0;
- for (;p != EOF;)
- {
- p = getchar();
- if (p == '\n') linie++;
- znaki++;
- }
- printf("znaki: ");
- printf("%lu", znaki);
- printf("linie: ");
- printf("%lu", linie);
- }
- void wypisz(){
- char tab[5][100], c;
- int p, linie = 0, x = 0;
- for(;p != EOF;)
- {
- p = getchar();
- if (linie < 3)
- {
- tab[linie][x] = p;
- c = tab[linie][x];
- //printf("%c", tab[linie][x]);
- putchar(c);
- x++;
- if (p == '\n') linie++;
- }
- else
- {
- tab[3][x] = p;
- //c = tab[3][x];
- //putchar(c);
- x++;
- if (p == '\n')
- {
- x = 0;
- while(x < 100)
- {
- c = tab[1][x];
- putchar(c);
- x++;
- }
- x = 0;
- while(x<100)
- {
- tab[0][x] = tab[1][x];
- x++;
- }
- x = 0;
- while(x < 100)
- {
- tab[1][x] = tab[2][x];
- x++;
- }
- x = 0;
- while(x < 100)
- {
- tab[2][x] = tab[3][x];
- x++;
- }
- x = 0;
- }
- //}
- }/*
- x = 0;
- while(x < 100000)
- {
- c = tab[1][x];
- putchar(c);
- x++;
- if (tab[1][x] == '\n'){
- //printf("PIZZAJESTSMACZNA!!!!");
- break;
- }
- }
- x = 0;
- while(x < 100000)
- {
- c = tab[2][x];
- putchar(c);
- x++;
- if (tab[2][x] == '\n') break;
- }
- x = 0;
- while(x < 100000)
- {
- c = tab[3][x];
- putchar(c);
- x++;
- if (tab[3][x] == '\n') break;
- }*/
- }
- int main()
- {
- //unsigned long x;
- //x = hash();
- //printf("%lu", x);
- //count();
- wypisz();
- }
Add Comment
Please, Sign In to add comment