题解列表

筛选

坤坤也能看懂

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a*a+b*b==c*c||b*……

很简单的水仙花,使我大脑旋转。

摘要:解题思路:直接按照水仙花定义求解注意事项:关键在于如何表示百位,十位,个位的数值,三位数除100再取10的余得百位,除10取10的余得十位,直接取10的余得个位。参考代码:#include <stdi……

函数+递归求解

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int sum=0;int f(int x){ int t=x;//(保存一下x的值……

三种方法解排序(C语言)

摘要:解题思路:注意事项:参考代码:方法1:使用冒泡排序#include // 冒泡排序函数 void bubbleSort(int arr[], int n) {     int temp;    ……

阿姆斯特朗数

摘要:解题思路:注意事项:hhh其实只用隔一个空格,被骗啦嘻嘻参考代码:#include<stdio.h>int main(){    int i,a,b,c,s;    for(i=2;i<1000;i+……

最大公约数与最小公倍数

摘要:解题思路:最大公约数的求法欧几里得算法是用来求两个正整数最大公约数的算法。古希腊数学家欧几里得在其著作《The Elements》中最早描述了这种算法,所以被命名为欧几里得算法。扩展欧几里得算法可用于……

2822: 求分数序列和

摘要:``` #include using namespace std; int main(){ int n; double a=1.0,b=2.0,c=0,sum=2,s; cin>>n……