绝对值排序-C语言代码 摘要:解题思路:用动态内存分配。注意事项:循环条件要用scanf("%d",&n)!=EOF。参考代码:#include<stdio.h>#include<malloc.h>#include <stdlib…… 题解列表 2022年03月29日 0 点赞 0 评论 528 浏览 评分:7.0
四行代码 摘要:解题思路:注意事项:参考代码:def f(n): n=str(n) return int(n[::-1])n,m=map(int,input().split())print(f(f(n)+…… 题解列表 2022年03月30日 0 点赞 0 评论 455 浏览 评分:7.0
不用数组版C语言-计负均正 摘要:解题思路:输一个判断一个注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n=0,m; double…… 题解列表 2022年04月01日 0 点赞 0 评论 515 浏览 评分:7.0
1187: 假币问题 摘要:解题思路:只要想清楚怎么做,剩下的代码就没问题,我之前想是平均分为两份,放入天平中,后来发现这种思路不是称量次数最少的方法,最好的做法便是分为3份注意事项:参考代码:#include<stdio.h>…… 题解列表 2022年04月02日 0 点赞 0 评论 738 浏览 评分:7.0
代码不长,for比较多,新手易懂 摘要:解题思路:将名次等价于分数,每家15分,9、8已经固定,7个数分为2、2、3组然后遍历注意事项:如下参考代码:#include<iostream>using namespace std; int…… 题解列表 2022年04月03日 0 点赞 0 评论 713 浏览 评分:7.0
统计字母个数 x=getchar() scanf("%c",&x) 摘要:#include int main() { char x,a[27]={"abcdefghijklmnopqrstuvwxyz"}; int b[26]={0}; while((x=ge…… 题解列表 2022年04月03日 0 点赞 0 评论 549 浏览 评分:7.0
绝对值排序 用数组 while(scanf("%d",&n)!=EOF&&n!=0) 摘要:#include <stdio.h> #include <math.h> int main() { int n,k; while(scanf("%d",&n)!=EOF&&n!=0){ …… 题解列表 2022年04月05日 0 点赞 0 评论 368 浏览 评分:7.0
优质题解 1069: 二级C语言-寻找矩阵最值 摘要:解题思路:(1)题目对于输入的二维矩阵只是要求找最大值,而找最大值的方法只是在每次输入值时进行比较和更新,故本题有个偷懒的写法:不建立二维数组,只需要用 for() 或者 while() 连续输入 n…… 题解列表 2022年04月16日 0 点赞 2 评论 2260 浏览 评分:7.0
编程入门]自定义函数之字符串反转(经典做法,建议收藏!!!) 摘要:解题思路:从后往前进行遍历输出。注意事项:一定要注意倒叙便利的范围!!!参考代码:#include<stdio.h>#include<string.h>void def(char *a){ //运用…… 题解列表 2022年04月24日 0 点赞 0 评论 784 浏览 评分:7.0
1001: [编程入门]第一个HelloWorld程序 摘要:解题思路:这道题其实就是简单的输入输出,即第一行输出“**************************”,第二行输出“Hello World!”,第三行输出“*******************…… 题解列表 2022年04月30日 0 点赞 0 评论 569 浏览 评分:7.0