求助读入TLE了,请问是什么原因,谢谢
#pragma warning(disable : 6031)
#include<bits/stdc++.h>
using namespace std;
struct student {
char s[25];
int nian, yue, ri, ord;
int ls;
};
student w[110];
int lw;
bool cmp_student(const student& a, const student& b) {
if (a.nian != b.nian) return a.nian < b.nian;
if (a.yue != b.yue) return a.yue < b.yue;
if (a.ri != b.ri) return a.ri < b.ri;
return (a.ord > b.ord);
}
int n;
char c;
int readint() {
int res = 0;
c = getchar();
while (c >= '0' && c <= '9') {
res = res * 10 + (c - '0');
c = getchar();
}
return res;
}
void read_n_student() {
for (int i = 0; i < n; i++) {
c = getchar();
while (c == '\r' || c == '\n') c = getchar();
while (c!=' ') {
w[lw].s[w[lw].ls++] = c;
c = getchar();
}
int nian = 0;
c = getchar();
while (c != ' ') {
nian = nian * 10 + (c - '0');
c = getchar();
}
w[lw].nian = nian;
int yue = 0;
c = getchar();
while (c != ' ') {
yue = yue * 10 + (c - '0');
c = getchar();
}
w[lw].yue = yue;
int ri = 0;
c = getchar();
while (c != '\n' && c != '\r') {
ri = ri * 10 + (c - '0');
c = getchar();
}
w[lw].ri = ri;
w[lw++].ord = i;
}
}
int main() {
n = readint();
read_n_student();
//sort(w, w + n, cmp_student);
/*for (int i = 0; i < n; i++) {
for (int j = 0; j < w[i].ls; j++) {
putchar(w[i].s[j]);
}
putchar('\n');
}*/
return 0;
}