fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct ksiegarnia
  5. {
  6. char imie[30];
  7. char znak;
  8. char tytul[30];
  9. int cena;
  10. }
  11. tb[100];
  12.  
  13. int main()
  14. {
  15. int i=0,count;
  16. while((i<100)&&(fscanf(stdin," %29[^;]s",tb[i].imie)>0)&&(fscanf(stdin,"%*c %c",&tb[i].znak)>0)&&(fscanf(stdin," %29[^;]s",tb[i].tytul)>0)&&(fscanf(stdin,"%*c %d",&tb[i].cena)>0)) count=++i;
  17. for(i=0;i<count;++i) fprintf(stdout,"%s; %c %s; %d\n",tb[i].imie,tb[i].znak,tb[i].tytul,tb[i].cena);
  18. return 0;
  19. }
Success #stdin #stdout 0s 2120KB
stdin
Zbigniew; a Janusze i Roberty; 10
Andrzej; b Radio; 15
Bogdan; a Plebania; 20
Jonasz; c Mosty; 17
stdout
Zbigniew; a Janusze i Roberty; 10
Andrzej; b Radio; 15
Bogdan; a Plebania; 20
Jonasz; c Mosty; 17