Submission #6756226


Source Code Expand

#include<cstdio>
using namespace std;
int main()
{
    int year,m,d;
    scanf("%d/%d/%d",&year,&m,&d);
    if((year*1.0/m/d)%1==0)
    {
        printf("%d/%d/%d\n",year,m,d);
    }
    else printf("0");
    return 0;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:23: error: invalid operands of types ‘double’ and ‘int’ to binary ‘operator%’
     if((year*1.0/m/d)%1==0)
                       ^
./Main.cpp:6:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d/%d/%d",&year,&m,&d);
                                  ^