C++
文章平均质量分 56
lightLinux
这个作者很懒,什么都没留下…
展开
-
使用map后,屏蔽warning 4786
问题: 编译时,总是报告警4786。是因为使用了map的stl方法。无影响可以屏蔽 D:\prg test\helloworld\helloworld.cpp(44) : warning C4786: 'std::reverse_bidirectional_iterator,std::map,std::allocator >::_Kfn,std::less,std::allocator >::转载 2015-02-26 21:47:25 · 789 阅读 · 0 评论 -
查找试题--map方法应用
题目: Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2 解答: #include "stdafx.h" #include "map" #include "st原创 2015-02-26 21:09:30 · 447 阅读 · 0 评论 -
数组反转试题解答
题目: Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Note: Try to come up as many solutions as原创 2015-02-26 22:17:05 · 551 阅读 · 0 评论 -
查找试题--互换函数swap初试
题目: Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2 试题解答: #include "stdafx.h" #include "map" #include原创 2015-02-26 20:30:15 · 519 阅读 · 0 评论 -
sort排序
要使用此函数只需用#include sort即可使用,语法描述为: sort(begin,end),表示一个范围,例如: int _tmain(int argc, _TCHAR* argv[]) { int a[20]={2,4,1,23,5,76,0,43,24,65},i; for(i=0;i cout sort(a,a+20); for(i=0;转载 2015-03-15 23:33:40 · 361 阅读 · 0 评论 -
对vector成员进行排序
对vector成员进行排序 #include "stdafx.h" #include "vector" #include using namespace std; class TappD { public: unsigned int appid; unsigned int d; unsigned int D; public: TappD(unsign原创 2015-03-15 23:26:46 · 943 阅读 · 0 评论 -
数字转换为罗马数字
Integer to Roman https://leetcode.com/problems/integer-to-roman/ Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. #includ原创 2015-03-21 11:49:03 · 524 阅读 · 0 评论