题解列表

筛选

1013: [编程入门]Sn的公式求和

摘要:解题思路:递归解题,22为2*10的一次方+前一个数2,222为2*10二次方加前一个数22注意事项:参考代码:import java.util.Scanner;public class Main {……

C语言训练-"水仙花数"问题2

摘要:解题思路: 思路分为两步:首先计算数据(i)的每一位的n次方之和(sum),再把sum和i进行比较,如果相等,那么输出这个数。注意事项:下面是个通用的代码,不止可以来计算三位数的,只要把for循环里面……

jiechenheshu11111111000

摘要:解题思路:注意事项:参考代码:#include "stdio.h"#include  "math.h"int  J(int n) //求阶乘{ if (n == 1||n==0)return 1; i……

归并排序(Java代码)

摘要:```java package datastrutures; import java.util.Scanner; /* * 题目 1719: 数据结构-归并排序 */ publ……

简单快速的亲和数

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m; while ((scanf("%d", &m)) != EOF ) { int x, y; f……

1116: IP判断(C++代码)

摘要:#include <iostream> #include <string> using namespace std; //判断ip是否合法  bool isLegal(string i……

编写题解 1206: 字符串问题(c++)

摘要:解题思路:相同的字符串进行逆转,用两个不同的变量i,j标记,i记录串尾位置,j记录串头位置,用个for循环就好参考代码:               #include <iostream>#inclu……

1111111111111111111111

摘要:解题思路:注意事项:参考代码#include "stdio.h"int main() { int n, m; while (scanf("%d%d", &n, &m)!=EOF) { int num……