1028 人口普查 (20 分)

#include

typedef struct townPerson
{
    char name[10];
    long long age;
    int year;
    int month;
    int day;
    int Legal;

}Person;

int main()
{
    int N;
    scanf("%d", &N);

    Person person[100010];
    int i, j=0, maxAge=0, minAgeNum=0, legalNum=0;
    long long  minAge=20140906, maxAgeNum=18140906;
    char c;
    for(i=0;i20140906 || person[i].age<18140906)
            person[i].Legal = 0;
        else
            person[i].Legal = 1;

        if(person[i].Legal == 1)
        {
            legalNum++;
            if(minAge>person[i].age)
            {
                minAge = person[i].age;
                minAgeNum = i;
            }

            if(maxAge

你可能感兴趣的:(1028 人口普查 (20 分))