MasterGun

Untitled

May 23rd, 2020
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. template<class T>
  5. void print(T* array)
  6. {
  7. int length = sizeof(array) / sizeof(array[0]);
  8. int sum{};
  9. int sum2;
  10. for (int i = 0; i < length; i++)
  11. {
  12. print(array, length);
  13. for (int i = 0; i < length; i++)
  14. {
  15. sum = sum + array[i];
  16. sum2 = sum / length;
  17. }
  18. cout << sum2 << endl;
  19. }
  20. }
  21.  
  22. int main(){
  23. int array1[]{ 1,2,3,4,5 };
  24. print(array1);
  25.  
  26. return 0;
  27. }
RAW Paste Data