| 22627 | 2026-01-15 12:42:09 | zo | Egykorúak (75 pont) | cpp17 | Compilation error |
#include <iostream>
using namespace std;
int main()
{
int o,l,m;
m=0;
int n,i,pe, ph,pn,x=0;
cin>>n;
cin>>pe>>ph>>pn;
int s[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int ev[n],honap[n],nap[n];
for (i=0; i<n; i++)
{
cin>>ev[i] >> honap[i] >> nap[i];
if (ev[i]==pe)
{
x=x+1;
}
else if (ev[i]==pe+1)
m=0;
{
if (honap[i]+12-ph<=12)
{
for (l=0; l<honap[i-1]; l++)
{
m=m+s[l];
}
m=m+nap[i];// hanyadik napon szuletett
o=m;
for (l=11; l>ph-1; l--)
{
m=m+s[l];
}
m=m+s[ph-1]-pn;
if (ev[i]%4==0 and o>=59 and m+1<=365)
{
x=x+1;
}
else if (pe%4==0 and m-o>=306 and m+1<=365)
{
x=x+1;
}
if (m<=365)
{
x=x+1;
}
}
}
if (ev[i]==pe-1 )
{
m=0;
for (l=0; l<ph-1; l++)
{
m=m+s[l];
}
m=m+pn;// hanyadik napon szuletett peti
o=m;
for (l=11; l>honap[i]; l--)
{
m=m+s[l];
}
m=m+s[ph-1]-nap[i];
if (ev[i]%4==0 and m-o>=306 and m+1<=365)
{
x=x+1;
}
else if (pe%4==0 and o>=59 and m+1<=365)
{
x=x+1;
}
else if (m<=365 and ev[i]%4!=0 and pe%4!=0)
{
x=x+1;
}
}
}
cout<<x<<endl;
return 0;open /var/local/lib/isolate/425/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:90:14: error: expected '}' at end of input
90 | return 0;
| ^
main.cpp:4:1: note: to match this '{'
4 | {
| ^