2018年3月的全部文章
@kidultff

PAT-A 真题- 1042. Shuffling Machine

原题干:Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate with gamblers by perfor ...
  • 0
  • 0
@kidultff

浅谈C++ vector作为参数传入函数

例如main函数有一个vector需要使用deal函数来处理内部数据,有下面三种办法:1、直接传入void deal(vector<int> v){     v.push_back(0); } main(){     vector<int> vec; & ...
  • 0
  • 0
@kidultff

PAT-A 真题- 1009. Product of Polynomials

原题干:This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K N ...
  • 0
  • 0
@kidultff

提高编程效率的工具:C++ STL容器(总结篇)

1、vector头文件:vector创建:vector<ElementType> v追加:v.push_back()删除末尾元素:v.pop_back()迭代器:vector<ElementType>::iterator首元素迭代器:v.begin()尾元素迭代器:v.end()元素个数:v.size()清空:v.clear()2、set头 ...
  • 0
  • 0
@kidultff

PAT-A 真题- 1008. Elevator

原题干:The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elev ...
  • 0
  • 0