Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int fsm(int c, int status) // търсим '111' във файла
- {
- if (status == 3)
- {
- status = 0;
- }
- switch (status)
- {
- case 0:
- if (c == '1')
- status = 1;
- break;
- case 1:
- if (c == '1')
- {
- status = 2;
- }
- else
- {
- status = 0;
- }
- break;
- case 2:
- if (c == '1')
- {
- status = 3;
- }
- else
- {
- status = 0;
- }
- break;
- }
- return status;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement