编写题解 2808: 买房子 解题思路:程序通过输入流Scanner读取年薪N和房价增长率K,并采用了一个循环结构,每年将年薪积攒到手头的积蓄中,然后判断积蓄是否足够买房子,如果足够则输出年份并退出程序。如果到了第20年仍然买不起房子,则输出Impossible。注意事项:参考代码:importjava.util.Scanner; 题解列表 2023年04月20日 0 点赞 0 评论 775 浏览 评分:9.9
2862: 字符串移位包含问题 解题思路:核心思路时解决唯一问题,在这里采用了把比较长的字符串增加一倍的方法来解决位移问题,如:样例s1=AABCDs2=CDAA两个s1即AABCDAABCD,如果s2在这个字符串中,即输出true,否则输出false。注意事项:参考代码:#includeusingna 题解列表 2023年04月20日 0 点赞 0 评论 717 浏览 评分:0.0
蓝桥杯算法训练VIP-学生成绩(c语言) ```c#include#includetypedefstructstudent{charname[20];charsex[7];intage;intscore;}stu;voidbubble_sort(stu*data,constintlen);intmain(){intn;scanf("%d", 题解列表 2023年04月20日 0 点赞 0 评论 730 浏览 评分:9.9
提货单(c语言) ```c#include#includetypedefstructdata{charmc[100];doubledj;intsl;}prut;intmain(){intn;scanf("%d",&n);getchar();prut*database=(prut*)malloc(n*sizeof(pru 题解列表 2023年04月20日 0 点赞 0 评论 652 浏览 评分:9.9
最长回文串马拉车算法(Manacher) 摘要:解题思路: 假设输入字符串为 S ① 题目关键点在于 s′ = s ⊕ rev(s) 可以字符串 s 进行一次该公式反转,然后再前后拼接 01 ,生成目标字符串 S …… 题解列表 2023年04月20日 0 点赞 0 评论 1154 浏览 评分:9.9
递归倒置字符数组(c语言) ```c#include#includevoidreverse(char*,int,int);intmain(){intn=0;charstr[100]={0};scanf("%d",&n);getchar();//scanf的结束输出要么输入空格要么回车gets(str);//如果没有getchar 题解列表 2023年04月20日 1 点赞 0 评论 819 浏览 评分:7.0
进制转换(我的怨种写法) ```c#include#includeintconvert(char*);intoct(int);intmain(){charhex[4]={0};scanf("%c%c%c",hex,hex+1,hex+2);if((hex[0]==48)&&(hex[1]==48)&&(hex[2]==48)) 题解列表 2023年04月20日 0 点赞 0 评论 593 浏览 评分:9.9
函数字符串的反转 ```c#include#includevoidf(chara[100]);intmain(){chara[100];gets(a);f(a);}voidf(chara[100]){charb[100];intl=strlen(a);`判断字符串长度`inti=0;for(i=0;a[i]!='\0' 题解列表 2023年04月20日 0 点赞 0 评论 580 浏览 评分:0.0
蓝桥杯算法提高VIP-质因数2(和质因数1一样) 摘要:```c #include int main() { int n; scanf("%d", &n); int i = 0, j = 0, max = n, cnt=0;//和质因数1…… 题解列表 2023年04月20日 0 点赞 0 评论 719 浏览 评分:9.9
字符串分类统计 #includeintmain(){chara[200];gets(a);intn1=0,n2=0,n3=0,n4=0;inti=0;for(i=0;a[i]!='\0';i++){if((a[i]>='a'&&a[i]='A'&&a[i]='0'&&a[i]引用文本##插入图片![](/image_ 题解列表 2023年04月20日 0 点赞 0 评论 559 浏览 评分:0.0