【递归】母牛的故事 解题思路:每3年,小母牛成年,并在从第四个年头开始,每年年初也生一头小母牛。例:第6年有6头新的小母牛,3头成年母牛,经过3年6头小母牛成年,并与其他成年母牛生出9头新的小母牛。总结出数据,即前4年母牛数量与年份相等,第4年以后的母牛数量等于第n-1年的母牛数量加第n-2年的母牛数量的和。 题解列表 2024年01月09日 1 点赞 0 评论 760 浏览 评分:10.0
2000: 偶数列举 2000: 偶数列举 2000: 偶数列举 2000: 偶数列举 2000: 偶数列举 2000: 偶数列举 2000: 偶数列举 2000: 偶数列举 2000: 偶数列举 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n; cin>>n; for(int i=2;i<…… 题解列表 2024年01月09日 1 点赞 2 评论 459 浏览 评分:10.0
全字符串输入 通用转换 求解 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] args…… 题解列表 2024年01月09日 1 点赞 0 评论 628 浏览 评分:10.0
2801: 奇数求和 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n,m; cin>>n>>m; l…… 题解列表 2024年01月13日 1 点赞 0 评论 768 浏览 评分:10.0
题解 3011: 余数相同问题 摘要:解题思路:定义三个长整型变量,写循环和选择判断x;注意事项:在循环中输出完x后要终止循环,不然会超时;参考代码:#include <bits/stdc++.h>using namespace std;…… 题解列表 2024年01月14日 1 点赞 0 评论 446 浏览 评分:10.0
函数重载之比较大小 摘要:解题思路:思路比较简单,写三个重载的函数就行了。注意事项:参考代码:import java.util.*; public class Main { public static voi…… 题解列表 2024年01月15日 0 点赞 0 评论 959 浏览 评分:10.0
题解 2824: 求出e的值 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ double n,e=1,num=0; cin…… 题解列表 2024年01月19日 0 点赞 0 评论 530 浏览 评分:10.0
2757:浮点数向零舍入 摘要:注意事项:参考代码:#include<stdio.h>int main(){ float a = 0; scanf("%f",&a); int b = 0; b = a; …… 题解列表 2024年01月19日 2 点赞 0 评论 815 浏览 评分:10.0
Python代码(简洁) s=input().strip()result=''#注意超出字母表之后就会重新回到A或aforcharins:ifchar.isupper():char=char.lower()result+=chr((ord(char)-ord('a')+3)%26+ord('a'))else:char=char 题解列表 2024年01月20日 0 点赞 0 评论 546 浏览 评分:10.0
编写题解 1670: 拆分位数 摘要:解题思路: 先定义一个整数n,并输入他的值,然后再分别拆分出百位、十位和个位(例:365/100=3……65 即百位为3;65/10=6……5 即十位为6;5/1=5 即个位为5),最后按照题目要…… 题解列表 2024年01月22日 3 点赞 0 评论 946 浏览 评分:10.0