Advertisement
Josif_tepe

Untitled

Jun 12th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4. #include <math.h>
  5.  
  6.  
  7. int main() {
  8. char z1, z2;
  9. char niza[100][100];
  10. int x = 0;
  11. while(fgets(niza[x], 90, stdin)) {
  12. if(niza[x][0] == '#') {
  13. break;
  14. }
  15. x++;
  16. }
  17. scanf("%c%c", &z1, &z2);
  18.  
  19. for(int i = 0; i < x; i++) {
  20. int S, E;
  21. for(int j = 0; j < strlen(niza[i]); j++) {
  22. if(niza[i][j] == z1) {
  23. S = j;
  24. }
  25. if(niza[i][j] == z2) {
  26. E = j;
  27. }
  28. }
  29. for(int j = S + 1; j < E; j++) {
  30. printf("%c", niza[i][j]);
  31. }
  32. printf("\n");
  33. }
  34.  
  35. return 0;
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement