fork download
  1. #include <iostream>
  2.  
  3. void scanf() {}
  4.  
  5. template <class T, class... Args>
  6. void scanf(T& value, Args& ...args)
  7. {
  8. std::cin >> value;
  9. scanf(args...);
  10. }
  11.  
  12. int main()
  13. {
  14. int a, b, c;
  15. double z;
  16. std::string str;
  17. scanf(z, a, b, str, c);
  18. std::cout << z << std::endl
  19. << a << std::endl
  20. << b << std::endl
  21. << str << std::endl
  22. << c << std::endl;
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 3432KB
stdin
12.1234
7
6
Hello
9
stdout
12.1234
7
6
Hello
9