``## c出勤记录##
小新老师每次都会统计学生的作业提交记录
如果作业迟交 就会记录一个L
如果作业没交 会记录一个A
准时完成会记录为O
一段时间后, 学生的作业提交记录可以看作是一个只包含LAO的字符串
如果学生整学期漏交不超过一次, 并且没有连续三次迟交 他的作业记录就算合格
设计一个程序, 判断学生的作业记录是否合格
输入:
一个字符串 表示学生的作业记录
输出:
如果作业记录合格 输出true 否则输出false
样例输入:
LLOLLALL
样例输出:
true
样例输入:
OLLLOOOO
样例输出:
false
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#define MAXSIZE 1024 //串的长度
//字符串
typedef struct
{
char memory[MAXSIZE]; //字符数组
int curSize; //串的长度参数
}string, * LPSTR;
//创建一个串
LPSTR createStr(const char* str);
//寻找匹配值(pstr ,串 next 储存匹配值的数组 ),
void getNext(LPSTR pstr, int next[]);
//KMP算法
int KMP(LPSTR pStr1, LPSTR pStr2, int next[]);
//接收用户输入
void str(char* s);
//记录未交作业次数
int num(char* s);
int main()
{
while (1)