fork download
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C/C++.
  5. Code, Compile, Run and Debug online from anywhere in world.
  6.  
  7. *******************************************************************************/
  8. #include <stdio.h>
  9. #include <vector>
  10. using namespace std;
  11.  
  12. void cetakLarik(int ukuran, vector<int> larik){
  13. int i;
  14. for(i = 0; i < ukuran; i++)
  15. printf("%d\n", larik[i]);
  16. }
  17.  
  18. int main(){
  19. vector<int> bilangan;
  20. int i;
  21. for(i = 0; i < 10; i++)
  22. bilangan.push_back(i);
  23. cetakLarik(10, bilangan);
  24.  
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
0
1
2
3
4
5
6
7
8
9