题解列表

筛选

石头剪刀布

摘要:解题思路:小A和小B的出拳是有周期性的。i % A 和 i % B 的作用是计算当前轮次 i 所对应的出拳规律的位置。当i达到或超过 A 或 B 时,取余操作会使其回到0。例如:如果 i 为 3,而 ……

编写题解 2945: 素数对

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

1796: 蛇形填数

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    int j;    int a[100][100] ……

2897: 神奇的幻方

摘要:解题思路:注意事项:参考代码:#include <stdlib.h> #include <stdio.h> #include <iostream> using namespace std; ……

校门外的树

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int L,M; scanf("%d%d",&L,&M); int n=L+1,sum=0;  //n:树量  ……

[编程入门]数字逆序输出

摘要:解题思路:注意事项:参考代码:Scanner sc = new Scanner(System.in); int[] arr = new int[10]; for (int i = 0; i < a……