fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename... Args>
  5. void print(Args... args)
  6. {
  7. int chapuza = 0;
  8. const int n = sizeof...(args);
  9.  
  10. using expandir = int[];
  11. (void) expandir {0, (chapuza++, chapuza == n ? std::cout << args << '\n' :
  12. std::cout << args<< ',', 0)...};
  13. }
  14.  
  15. int main() {
  16. // your code goes here
  17. print(1,2,3,4,5);
  18. return 0;
  19. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
1,2,3,4,5