Submission #6347944


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
int y,m,d,t;
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
bool leap(int year)
{
    return (!(year%4)&&year%100||!(year%400));
}
int main()
{
    cin>>y>>ch>>m>>ch>>d;
    if(leap(y))
    a[2]++;
    while (y%(d*m))
    {
        ++d;
        if (d>a[m])
        {
            m++;
            d=1;
        }
        if (m>12)
        {
            ++y;
            m=1;
        }   
    }
    cout<<y<<'/'<<m/10<<m%10<<'/'<<d/10<<d%10<<endl;
    return 0;
}

Submission Info

Submission Time
Task B - 割り切れる日付
User luogu_bot3
Language C++14 (GCC 5.4.1)
Score 0
Code Size 539 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:13: error: ‘ch’ was not declared in this scope
     cin>>y>>ch>>m>>ch>>d;
             ^