fork download
  1. #include <iostream>
  2. #include <sstream>
  3.  
  4. int main()
  5. {
  6. std::istringstream infile ("100 90 80 78 67 56 20 78 99 54 89 100 90 80");
  7. for(int i = 0, num; infile >> num; ++i)
  8. {
  9. if(i%3 == 0)
  10. {
  11. std::cout << num << " " << std::flush;
  12. }
  13. }
  14. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
100 78 20 54 90