Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4.  
  5. int main(){
  6. char hallgato[255];
  7.  
  8. char neptun[255][255];
  9. int db=0;
  10.  
  11. while(1){
  12. fgets(hallgato,sizeof(hallgato),stdin);
  13. if(strcmp(hallgato,"vege\n")==0){
  14. break;
  15. }
  16.  
  17. //Egy hallgato 6 infojat kimentjuk egy 6 elemu, stringeket tartalmazo tombbe
  18. char tmp[6][255]; //neptun, nev, targykod, targynev, kredit, jegy
  19. char *szetszedett=strtok(hallgato,";");
  20.  
  21. int i=0;
  22. while(szetszedett!=NULL){
  23. strcpy(tmp[i],szetszedett);
  24. printf("%s\n",tmp[i]);
  25. szetszedett=strtok(NULL,";");
  26. i++;
  27. }
  28.  
  29. for(i=0;i<6;i++){
  30. printf("%s\n",szetszedett[i]);
  31. }
  32. }
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement