自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 问答 (2)
  • 收藏
  • 关注

原创 51nod 1049 最大子段和

N个整数组成的序列a[1],a[2],a[3],…,a[n],求该序列如a[i]+a[i+1]+…+a[j]的连续子段和的最大值。当所给的整数均为负数时和为0。例如:-2,11,-4,13,-5,-2,和最大的子段为:11,-4,13。和为20。Input第1行:整数序列的长度N(2 <= N <= 50000)第2 - N + 1行:N个整数(-10^9 Output

2016-10-25 11:12:28 182

原创 安卓标题栏不显示及标题栏无法隐藏问题

1.安卓标题栏不显示的原因 活动是按照教材(Android第一行代码)上继承的Activity,但打开主题的styles.xml,会发现设定中用到了AppCompat的主题解决办法就是让所有的活动都继承 AppCompatActivity就行了,如下:public class 活动 extends AppCompatActivity2.

2016-09-18 21:38:10 3335 1

原创 51nod 1046 A^B Mod C

给出3个正整数A B C,求A^B Mod C。例如,3 5 8,3^5 Mod 8 = 3。Input3个正整数A B C,中间用空格分隔。(1 Output输出计算结果Input示例3 5 8Output示例3这题,如果直接算a^b的话,数太大,无法存放,且时间复杂度是O(b),太大,会超时因为公式(a*b) mod n=[(a mod n)*(b m

2016-09-13 18:32:24 241

原创 51nod 1027 大数乘法

给出2个大整数A,B,计算A*B的结果。Input第1行:大数A第2行:大数B(A,B的长度 = 0)Output输出A * BInput示例123456234567Output示例28958703552import java.math.BigInteger;import java.util.Scanner;public class answer

2016-09-12 21:58:40 233

原创 51nod 1057 N的阶乘

Input输入N(1 Outputimport java.util.Scanner;public class answer { public static void main(String[] args) { Scanner cin=new Scanner(System.in); int n=cin.nextInt(); long a[]=new long[100000

2016-09-11 20:11:10 204

原创 算法导论 第二章

第二章 插入排序#include #include using namespace std;templatevoid InsertSort(T array[], int length){    int i;    for (int j = 1; j < length; j++){        T key = array[j];        i = j - 1;    

2016-01-27 16:17:21 305

转载 C++ 文件结束符

问题描述:windows下int main(){ string str; while(cin>>str); cout<<"\n"<<"end"<<endl;}控制台输入多个字符串后,输入文件结束符crtl-Z,并未使while循环结束,该如何跳出while循环? 解决方法:方法1:回车 - ctrl-z - 回车 方法2:改代码,设

2016-01-24 14:11:27 564

原创 C++ primer P116 练习3.43

#include #include #include using namespace std;int main(){ int ia[3][4] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; for (int (&p)[4] : ia){ for (int q : p){ cout << q << " ";

2016-01-24 14:07:08 358 1

原创 C++ primer P99 练习3.23

#include #include #include using namespace std;int main(){ vector vec; int num; int count=0; cout << "please input 10 numbers:" << endl; while (cin >> num&&count<10){ vec.push

2016-01-24 14:05:27 341

原创 C++ primer P94 练习3.20

#include #include #include using namespace std;int main(){ vector vec; int num; cout << "please input the numbers:" << endl; while (cin >> num){ vec.push_back(num); } int l

2016-01-24 14:03:43 321

原创 C++ primer P94 练习3.17

#include #include #include using namespace std;int main(){ vector vec; string str; while (cin >> str){ vec.push_back(str); } for (auto &s : vec){ int j = 0; while

2016-01-24 14:02:35 223

原创 C++ primer P82 练习3.10

#include #include using namespace std;//using namespace string;int main(){ string s; string s1; getline(cin, s); for (auto &c : s){ if (!ispunct(c)){ s1 = s1 + c;

2016-01-24 14:01:29 306

原创 C++ primer P82 练习3.6

#include #include using namespace std;//using namespace string;int main(){ string s; cin >> s; for (auto &c : s){ c = 'x'; } cout << s << endl; return 0;}

2016-01-24 13:59:38 269

原创 C++ primer P81 练习3.5

#include #include using namespace std;int main(){ string s,s1,s2; int i = 0; string str[100]; while (cin >> s){ str[i] = s; cout << s << endl; i++; } int j;

2016-01-24 13:37:27 225

原创 每次重装系统的步骤

改bios,F2,priority->安装->将快捷方式恢复->驱动人生还原驱动->360体检安装补丁->安装qq拼音输入法->重新安装vc++6.0->重新配置配置java环境变量—>安装winrar->安装adobe reader->安装office(注意安装在安装文件夹里,先把里面的东西删掉),并激活->激活win7

2016-01-03 17:30:01 228

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除