1116: IP判断(异常 boolean标记) 摘要:```java 运用try catch 进行判断,因为题目要求必须要以数字开头,所以切分后的字符串只有可以转换成为int类型和不能转换为int类型两种,当不能转换的时候就会报错,就可以用try ca…… 题解列表 2022年04月10日 0 点赞 0 评论 612 浏览 评分:9.9
利用while,不过搞不懂末尾应该以什么为结束符,有想法的进来讨论一下 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ char c; int a[4]={0}; whil…… 题解列表 2022年04月10日 0 点赞 1 评论 865 浏览 评分:8.0
细细体会,简单易懂,新人不容易。 摘要:#define _CRT_SECURE_NO_WARNINGS #include int main() { int n, m; int a, sum; while (scanf("%…… 题解列表 2022年04月09日 0 点赞 0 评论 417 浏览 评分:9.9
题解 1027: [编程入门]自定义函数处理最大公约数与最小公倍数 摘要:解题思路:最大公约数的for循环从m n中最小的开始,逐渐减到1,第一个符合条件的就是最大的;最小公倍数的for循环从1开始,逐渐增加到m*n,第一个符合条件的就是最小的。一旦符合条件,就用break…… 题解列表 2022年04月09日 0 点赞 0 评论 560 浏览 评分:9.9
优质题解 题解 1018: [编程入门]有规律的数列求和 摘要:解题思路:观察数列可知其规律,从第二项开始,分子是前一项的分子和分母数字之和,分母的大小是前一项分子。将分子定义为up,分母定义为down,在循环次数为n的for循环里,要做两件事:第一,把up/do…… 题解列表 2022年04月09日 2 点赞 2 评论 2429 浏览 评分:9.1
编写题解 1016: [编程入门]水仙花数判断(python超短易理解) 摘要:解题思路:注意事项:参考代码:for i in range(100, 1000): if pow(int(str(i)[0]), 3) + pow(int(str(i)[1]), 3…… 题解列表 2022年04月09日 0 点赞 0 评论 576 浏览 评分:8.0
编写题解 1011: [编程入门]最大公约数与最小公倍数(python) 摘要:解题思路:通过for循环求出最大公因数,再通过“最小公倍数=两数之积/最大公因数”得出最小公倍数注意事项:最后输出是整型参考代码:m, n = map(int, input().split(" "))…… 题解列表 2022年04月09日 0 点赞 0 评论 1075 浏览 评分:8.9
二级C语言-计负均正(2022年4月9日17:17:32) 摘要:# include <stdio.h># include <malloc.h> int main(){ int i,n=0; int sum1=0; float sum2=0.0…… 题解列表 2022年04月09日 0 点赞 0 评论 380 浏览 评分:0.0
二级C语言-同因查找(2022年4月9日17:05:23) 摘要:# include <stdio.h>int main(){ int i,n; for(i=10;i<=1000;i++) { if(i%2==0 && i%3==0 && i%7==0) pr…… 题解列表 2022年04月09日 0 点赞 0 评论 423 浏览 评分:0.0
二级C语言-等差数列(2022年4月9日17:01:04) 摘要:# include int main() { int i,n; int sum = 0; scanf("%d",&n); for(i = 2; i…… 题解列表 2022年04月09日 0 点赞 0 评论 372 浏览 评分:0.0