上一页 1 ··· 8 9 10 11 12
摘要: 题目: 先讲变量 n:右下角的x值 m:右下角的y值 ans:答案(有几种可能) a数组:用来存储向下和向右的动作。 x:所在的位置的x值 y:所在位置的y值 x1:下一步可以走到位置的x值 y1:下一步可以走到位置的y值 题型:经典dfs。 代码: #include<bits/stdc++.h> 阅读全文
posted @ 2022-02-05 10:09 王浩泽 阅读(57) 评论(0) 推荐(0)
摘要: 题目: 数组意义: a字符数组:输入的数组一。 b字符数组:输入的数组二。 int 类型的t:存放strcmp(a,b)的结果。 那再说说思路,因为所以先统一为小写,再用strcmp就ok了。 上代码🐱‍🏍 #include <iostream> #include <cstring> #incl 阅读全文
posted @ 2022-02-02 11:32 王浩泽 阅读(668) 评论(0) 推荐(0)
摘要: 题目: 变量意义如下: x:输入的数。 s[i]:x从个位数起(包括个位)的第i位数。(注意:此处数组一定要开在main主函数外) a:x的替身。(为了防止改变x) b:x的位数。 先说说我的思路: 用while算出x的长度并把x的每一位数放入s数组 。每进行一次循环b++,s[b]=a%10,a/ 阅读全文
posted @ 2022-01-29 21:43 王浩泽 阅读(143) 评论(0) 推荐(0)
摘要: 今天勤快懒亿点。就直接发题解了,明天再发思路。也会再在这儿放个思路链接。 题解: #include<bits/stdc++.h> using namespace std; int main() { long long n,a=1,b=0,c=0; cin>>n; for(int i=1;i<=n;i 阅读全文
posted @ 2022-01-19 22:04 王浩泽 阅读(53) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 int n;//n:数组有几个数 6 cin>>n; 7 int a[1000];//a:存放数组 8 for(int i=1;i<=n;i++) cin>>a[i 阅读全文
posted @ 2022-01-18 12:21 王浩泽 阅读(62) 评论(6) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 double n;//n:要游的距离 6 cin>>n; 7 double b=2;//b:已经走的步数 8 double by=2;//by:每步游的距离 9 i 阅读全文
posted @ 2022-01-18 11:49 王浩泽 阅读(87) 评论(0) 推荐(0)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int z(int a) 4 { 5 if(a==2) return 1; 6 if(a==1) return 0; 7 for(int i=2;i*i<=a;i++) 8 { 9 if(a%i== 阅读全文
posted @ 2022-01-18 11:35 王浩泽 阅读(130) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int main() { int k,m=0,p=1;//p:给j个金币的第p天(1~j循环变化) cin>>k; for(int i=1,j=1;i<=k;i++)//i:天数,变化范围1~k,每次加1 { 阅读全文
posted @ 2022-01-18 11:11 王浩泽 阅读(82) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12