fork(2) download
  1. #include <stdio.h>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5. int getRegIndex(int num,vector<int> &reg){
  6. reg.resize(reg.size()+1);
  7. return reg.size()-1;
  8. }
  9. int main() {
  10. vector<int> reg;
  11. for(int i=0;i<10;++i){
  12. int x=getRegIndex(1,reg);
  13. int y=getRegIndex(2,reg);
  14. reg[x]=y;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 3268KB
stdin
Standard input is empty
stdout
Standard output is empty