fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<typename T>
  5. void print(T t)
  6. {
  7. cout << t << endl;
  8. }
  9.  
  10. template<typename T, typename ... Args>
  11. void print(T t, Args ... a)
  12. {
  13. cout << t << " ";
  14. print(a...);
  15. }
  16.  
  17.  
  18. template<typename T, typename ... Args>
  19. void print(const char* params, T t, Args ... a)
  20. {
  21. cout << params << ": ";
  22. cout << t << " ";
  23. print(a...);
  24. }
  25.  
  26. #define A(x) #x
  27.  
  28. int main() {
  29. // your code goes here
  30. print(A(1111), 7, 12, 15);
  31. return 0;
  32. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
1111: 7 12 15