题解列表

筛选

自定义函数判断闰年

摘要:解题思路:注意事项:参考代码:#include <stdio.h> int is_prime_year(int x) {     if((x%4==0&&x%100!=0)||x%400==0)……

宏定义之闰年判断

摘要:解题思路:在这题中使用定义宏的方法比使用定义函数的方法更简单注意事项:#define 定义常量和宏注意 #define 后面没有分号;#define 常量名 常量值#define 宏名 宏表达式参考代……

新手简单快速解决!!!

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    int n = 0, x = 0, y = 0;    cin ……

JAVA的简单解法

摘要:解题思路:注意事项:主要注意要使用Math.ceil()向上取整参考代码:import java.util.Scanner;public class Main {    public static v……

非递归方法解决最长公共子序列

摘要:解题思路:使用二维数组来记录相等的情况,根据左边和上方的数字以及相等的情况来为二维数组赋值注意事项:起始项为【1,1】,所以要i-1,j-1;参考代码:#include <iostream>#incl……

C语言 AC通过

摘要:include <stdio.h> #include <string.h> int main() {     char input[1001];     scanf("%s", input);……

C++_dfs容易理解

摘要:解题思路:10个位置每个位置上找到满足的数放置注意事项:参考代码:#include <iostream>#include <cmath>using namespace std;int n;int ar……