题解列表

筛选

题解 2042: 杨辉三角

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const ll N =1e3;ll a……

编写题解 2820: 含k个3的数

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int jgs(int n) { int j=0;while(n){if(n%10=……

编写题解 2828: 与7无关的数

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool bsq(int n) { for(int i=1;i<=n;i++) { ……

辗转相除法(c语言)

摘要:解题思路:辗转相除法通过除数与余数之间不断求余,直到为零,最后的的余数就为最大公因数。注意事项:return (m%n==0)?n:gcd(n,m%n);这一段代码就已经实现了两个数的大小判断。参考代……

鸡兔同笼问题(C语言)

摘要:解题思路:注意事项:无解的情况为结果小于零或者不为整数参考代码:#include <stdio.h>int main(){ int a,b;    while(scanf("%d %d",&a,&b)……

for循环统计(c语言)

摘要:解题思路:注意事项:如果不是if{}else if{}的形式,内存会过大。参考代码:#include #include int main(void) {     char str[200]; ……