付给招聘网站的费用怎么做分录,开封网站建设培训班,长沙征帆网站建设,商城网站制作明细今天很慵懒啊#xff0c;啥事也没做#xff0c;把高精度复习了一遍#xff08;hdu1002#xff09;。 首先俩字符串数组输入#xff0c;然后按字符串的长度逆序转到整形数组里 #xff08;主要是为了把数值的最低位移动到数组的最低位#xff0c;方便进位#xff09;啥事也没做把高精度复习了一遍hdu1002。 首先俩字符串数组输入然后按字符串的长度逆序转到整形数组里 主要是为了把数值的最低位移动到数组的最低位方便进位 然后对应的位相加存储到一个新的整形数组里这时不考虑进位 最后遍历数组处理进位问题再倒序输出即是答案。 还有一个题hdu1003是说求一个数列里的子序列中的最大和这个还是没有想清楚啊。 现在想的大概的思路是找到负值最大的数的位置然后就能把数列划分为两个小数列 如果在数列的一头或一尾那么就还是一个数列求其和。但是后续可能会有新的问题 比如可能要再划分一次才能找到最大的子序列和。突然想起这有点像快排的思路额明天再处理吧。 1 #include stdio.h2 #include string.h3 #include stdlib.h4 #include math.h5 #include iostream6 #include algorithm7 #define MAXN 10000001008 using namespace std;9 int a[MAXN];
10
11 int main()
12 {
13 int t,kase;
14 scanf(%d,t);
15 for(kase1; kaset; kase)
16 {
17 int n, i, s, e, maxsum, maxhere, len;
18 scanf(%d,n);
19 for(i0; in; i)
20 scanf(%d,a[i]);
21 maxsum -2000;
22 maxhere 0;
23 s 0;
24 e 0;
25 for (i0; in; i)
26 {
27 if (maxhere 0)
28 {
29 maxhere a[i];
30 s 1;
31 }
32 else
33 {
34 maxhere a[i];
35 s;
36 }
37 if (maxhere maxsum)
38 {
39 maxsum maxhere;
40 len s;
41 e i;
42 }
43 }
44 if(kase t)
45 printf(Case %d:\n%d %d %d\n,kase,maxsum,e-len2,e1);
46 else
47 printf(Case %d:\n%d %d %d\n\n,kase,maxsum,e-len2,e1);
48 }
49 return 0;
50 } HDU1003 转载于:https://www.cnblogs.com/catdrivedragon/p/3524618.html