2018年3月25日

cout输出小数位数

摘要: #include #include /* 需要头文件:"iomanip" iomanip表示: io manipulator */ using namespace std; int main() { float a = 0.123000789; cout.setf(ios::fixed);//打开自动补位 cout << "a=" <<fixed<< setprec... 阅读全文

posted @ 2018-03-25 13:45 血腥刽子手 阅读(227) 评论(1) 推荐(0) 编辑

2018年3月24日

优先队列和排序的不同

摘要: #include"iostream" #include"algorithm" #include"queue" using namespace std; const int maxn=5e4+5; struct AAA { int t; bool operatorque; AAA a[10]={1,2,3,6,5,4}; for(int i=0;i<6;i++)qu... 阅读全文

posted @ 2018-03-24 20:43 血腥刽子手 阅读(246) 评论(0) 推荐(0) 编辑

2018年3月21日

二分查找总结

摘要: 之前一直以为二分查找很简单,结果(╯︵╰) 每次用都会出错,今天就来总结一下~ 怎么记住: (默认是递增的) 1.if里面与与想要的结果一样,想要 >= 里面就是 >= ,第一个大于等于key说明是往左边找,所以也返回左边,其他同理。 阅读全文

posted @ 2018-03-21 20:36 血腥刽子手 阅读(157) 评论(0) 推荐(0) 编辑

导航