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 <iostream>
  9. using namespace std;
  10.  
  11. int DigitsExtract(int Dg[],int number)
  12. {
  13. int s=0;
  14. for(int i=1;number!=0;i++)
  15. {
  16. Dg[i]=(number/(10*i))%10;
  17. s+=i;
  18. }
  19. return s;
  20. }
  21. int main()
  22. {
  23. int n;
  24. int A[n];
  25. cin>>n;
  26. DigitsExtract(A,n);
  27. return 0;
  28. }
  29.  
  30.  
  31.  
Success #stdin #stdout 0.01s 5284KB
stdin
45
stdout
Standard output is empty