problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
luogu::P5716类 参考

洛谷 P5716 【深基3.例9】月份天数 更多...

#include <luogu.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

洛谷 P5716 【深基3.例9】月份天数

在文件 luogu.h164 行定义.

成员函数说明

◆ main()

int luogu::P5716::main ( istream &  cin,
ostream &  cout 
)
static

在文件 luogu.cpp430 行定义.

430 {
431 int year;
432 int month;
433 cin >> year >> month;
434 const bool bissextile = year % 400 == 0 || year % 4 == 0 && year % 100 != 0;
435 if(month == 4 || month == 6 || month == 9 || month == 11) {
436 cout << 30;
437 } else if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
438 cout << 31;
439 } else if(bissextile) {
440 cout << 29;
441 } else {
442 cout << 28;
443 }
444 return 0;
445 }

被这些函数引用 luogu::TEST().


该类的文档由以下文件生成: