Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <stdio.h>
- #include<math.h>
- using namespace std;
- int main(){
- char input[1000], out[1000] = { '\0' };
- gets_s(input, 1000);
- int count = 0;
- char *point = input;
- char *cyka;
- bool check = false;
- cyka = strrchr(input, ' ');
- puts("1st part");
- // wrg r r 444444444
- for (int i = cyka-point; i > -1; i--)
- {
- if (input[i] != ' ') count++;
- else if (input[i] == ' ')
- {
- if (input[cyka - point - 4] == input[i] && count == 3)
- {
- strncpy(out, &input[cyka - point - 3], 3);
- puts("out");
- break;
- }
- else if(check==false)
- {
- i -= count;
- check = true;
- count = 0;
- }
- else if(check==true&&count!=0)
- {
- strncpy(out, &input[i], count);
- puts("out");
- break;
- }
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement