fork(2) download
  1. #include <iostream>
  2. #include <string>
  3. #include <utility>
  4.  
  5. template <class T>
  6. void Read(T& item) {
  7. std::cin >> item;
  8. }
  9.  
  10. template <class T, class... Args>
  11. void Read(T& item, Args&&... args) {
  12. Read(item);
  13. Read(std::forward<Args>(args)...);
  14. }
  15.  
  16. int main() {
  17. int a, b;
  18. std::string str;
  19.  
  20. Read(a, b, str);
  21.  
  22. std::cout << a << " " << b << " " << str;
  23. }
Success #stdin #stdout 0s 3432KB
stdin
42 13 hello
stdout
42 13 hello