Advertisement
Guest User

@vj

a guest
Apr 25th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(){
  5.  
  6. char c;
  7. char t[100];
  8. int i=0;
  9. int szam1;
  10. int szam2;
  11.  
  12.  
  13. do {
  14.         scanf("%c", &t[i]);
  15.         if(t[i]==64)
  16.                 break;
  17.         i++;
  18. } while(1 );
  19. /*while(1){
  20. t[i]=scanf("%c", &c);
  21. if(c==64)
  22.         break;
  23.     i++;
  24. }*/
  25.  
  26. printf("\n\n");
  27. printf("Adj meg ket szamot: ");
  28. printf("\n\n");
  29.  
  30. scanf("%d", &szam1);
  31. scanf("%d", &szam2);
  32. //if(szam1<=szam2)
  33. //if(szam1 <= strlen(t)-1 && szam2<=strlen(t)-1)
  34. for(i=szam1; i<=szam2; i++){
  35.         printf("%c", t[i]);
  36. }
  37.  
  38.  
  39.  
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement