Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- #include <math.h>
- int main() {
- char z[20];
- char niza[100][100];
- int x = 0;
- while(fgets(niza[x], 90, stdin)) {
- if(niza[x][0] == '#') {
- break;
- }
- x++;
- }
- fgets(z, 10, stdin);
- char z1 = z[0];
- char z2 = z[1];
- for(int i = 0; i < x; i++) {
- int S = -1, E = -1;
- for(int j = 0; j < strlen(niza[i]); j++) {
- if(isspace(z1)) {
- if(isspace(niza[i][j]) && S == -1) {
- S = j;
- }
- }
- if(niza[i][j] == z1 && S == -1) {
- S = j;
- }
- if(niza[i][j] == z2 && E == -1) {
- E = j;
- }
- }
- for(int j = S + 1; j < E; j++) {
- printf("%c", niza[i][j]);
- }
- printf("\n");
- }
- return 0;
- }
- /*
- 12345 Maja Majovska: 54
- 15145 Aco Acoski: 95
- 14785 Martin Martinoski: 87
- #
- :
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement