2020年2月8日
摘要: 数值较大,所以选用字符串解决该问题。考虑到进位的问题,所以从字符串数组的末位开始往前依次相加,因为两个0~9的数相加最多往前面进一位,所以定义一个flag,用来记录是否要进位。 #include<iostream>#include<string.h>#include<string>using nam 阅读全文
posted @ 2020-02-08 21:13 灬旧人灬 阅读(103) 评论(0) 推荐(0) 编辑
  2019年4月1日
摘要: #include<iostream>#include<algorithm>#include<string.h>using namespace std;int p[100],a[100];void dfs(int n,int* p,int* a,int pos)//n是元素个数,p是初始元素集合,po 阅读全文
posted @ 2019-04-01 20:57 灬旧人灬 阅读(140) 评论(0) 推荐(0) 编辑
  2019年3月31日
摘要: #include<iostream>#include<string.h>using namespace std;int a[20];int dp[20][2];int dfs(int pos,bool pre,bool limit)//pos表示当前的数位,pre表示前一位是否为6,limit用来判 阅读全文
posted @ 2019-03-31 20:02 灬旧人灬 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 具体可以看此博客https://blog.csdn.net/Sunshine_victory/article/details/76848883 #include<iostream>using namespace std;int a[100];//用来存储所需要输出的数 int visit[100]; 阅读全文
posted @ 2019-03-31 11:15 灬旧人灬 阅读(285) 评论(0) 推荐(0) 编辑
  2019年3月17日
摘要: #include<stdio.h>#include<iostream>using namespace std;int main(){ int k,x,y,ans; while(cin>>k&&k!=0) { ans=0; for(int y=k+1;y<=k<<1;y++) { x=(k*y)/(y 阅读全文
posted @ 2019-03-17 17:47 灬旧人灬 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<iostream>#include<string.h>#include<algorithm>using namespace std;int main(){ int n; int a[20]; long long mul=1; long long m 阅读全文
posted @ 2019-03-17 16:58 灬旧人灬 阅读(97) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<iostream>#include<string.h>using namespace std;int main(){ int n,j,ans=0,h=0,frist=0; int a[11]; while(cin>>n&&n!=0) { h=0; 阅读全文
posted @ 2019-03-17 16:10 灬旧人灬 阅读(321) 评论(0) 推荐(0) 编辑