3154 字符简写(新手上路,求大佬指正)(动态规划) 摘要:解题思路:对于输入的数据我们只需要辨别是否是字符c1和c2。对一个符合题目要求的子串来说,结尾一定是c2字符,开头为c1字符。因此只需要将每个c2字符前c1字符的个数相加即可。同时子串有长度n的限制,…… 题解列表 2023年11月03日 0 点赞 0 评论 409 浏览 评分:0.0
C语言温度转换 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int ctof(int c){ return (32+c*9/5);}int main(){int c=-100,f;while…… 题解列表 2023年11月03日 0 点赞 0 评论 262 浏览 评分:0.0
自由下落的距离计算 摘要:解题思路:因为第一次和其他不一样把第一次拿出来算,然后求反弹的距离,反弹的距离就是落下的距离注意事项:这个有不足的地方,没有报错的情况参考代码:#include<stdio.h>int main(){…… 题解列表 2023年11月03日 0 点赞 0 评论 253 浏览 评分:0.0
C语言 自定义函数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>double fact(int n)//计算n的阶乘{ double m = 1.0; for (int i = 1; i <= n; …… 题解列表 2023年11月03日 0 点赞 0 评论 202 浏览 评分:0.0
最小绝对值 数组 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,max,min;//最大和最小数的下标 int arr[10];//求完绝对值的数组 int arr…… 题解列表 2023年11月03日 0 点赞 0 评论 286 浏览 评分:0.0
1094: 字符串的输入输出处理 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i; scanf("%d",&i); getchar(); char a[100]; for(i…… 题解列表 2023年11月03日 0 点赞 0 评论 224 浏览 评分:0.0
1095: The 3n + 1 problem 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int f(int n){ int i=1; while(n!=1) { if(n%2==0) n=n/2; else …… 题解列表 2023年11月03日 0 点赞 0 评论 189 浏览 评分:0.0
巨大的数(因为只需要求个位,那每次的乘积只保留个位就行) 摘要:参考代码: ```c #include int main() { int n; scanf("%d",&n); long long sum=1;//不用在意long long 这是…… 题解列表 2023年11月04日 0 点赞 0 评论 246 浏览 评分:0.0
数组插入处理 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i, j, n, temp, a; int arr[10]; int add[10]…… 题解列表 2023年11月04日 0 点赞 0 评论 130 浏览 评分:0.0
二维数组的转置 摘要:解题思路:当j>i时换(等号有没有都行)注意事项:参考代码:#include<stdio.h>int main(){ int i, j; int temp; int arr[3][3…… 题解列表 2023年11月04日 0 点赞 0 评论 193 浏览 评分:0.0