1039: [编程入门]宏定义之闰年判断 摘要:```cpp #include #define LEAP_YEAR(y) (y%100!=0&&y%4==0||y%400==0)?'L':'N' int main() { int y;…… 题解列表 2022年12月06日 0 点赞 0 评论 842 浏览 评分:7.0
C++三目超简 摘要:解题思路:如果年份整除于4但不整除于100则为普通闰年,如果年份整除于400则为世纪闰年.我们可以通过三目运算符来进行判断。注意事项:注意格式规范参考代码:#include <iostream>#de…… 题解列表 2022年11月26日 0 点赞 0 评论 475 浏览 评分:7.3
C语言 宏定义之闰年判断& 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>#define LEAP_YEAR(y) if(((y%4==0)&&(y%100!=0))||(y%4…… 题解列表 2022年11月19日 0 点赞 0 评论 177 浏览 评分:0.0
定义宏,判断是否为闰年 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;#define LEAP_YEAR(y) y%100 ==0 && y%4 ==0 && y…… 题解列表 2022年10月26日 0 点赞 0 评论 232 浏览 评分:0.0
三目运算符简化闰年 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#define LEAP_YEAR(y) (y%4==0&&y%100!=0||y%400==0)?'L':'N…… 题解列表 2022年10月16日 0 点赞 0 评论 886 浏览 评分:9.7
宏定义之闰年判断 摘要: #include #include #include using namespace std; #define LEAP_YEAR(y) fun(y);…… 题解列表 2022年10月12日 0 点赞 0 评论 223 浏览 评分:0.0
编写题解 1039: [编程入门]宏定义之闰年判断 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#define LEAP_YEAR(y) (y%4==0 && y%100!=0 || y%400==0)void main(){ …… 题解列表 2022年09月08日 0 点赞 0 评论 235 浏览 评分:0.0
小南解题-[编程入门]宏定义之闰年判断--50ms 摘要:n=int(input())if n%400==0 or (n%4==0 and n%100!=0): print('L')else: print('N')…… 题解列表 2022年08月28日 0 点赞 0 评论 258 浏览 评分:0.0
题目 1039: [编程入门]宏定义之闰年判断 摘要:```cpp #include using namespace std; int main() { int a; cin >> a; if (a % 400 ==…… 题解列表 2022年08月23日 0 点赞 2 评论 375 浏览 评分:8.0
[编程入门]宏定义之闰年判断 摘要:解题思路:解决此问题需要知道闰年有什么特点,普通闰年的特点是能够被四百整除,所以此处定义的宏所表示的字符串写作y%400==0,如果此条件为真,则打印输出L;否则打印输出N。参考代码:#include…… 题解列表 2022年06月15日 0 点赞 0 评论 177 浏览 评分:6.0