fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. ios_base::sync_with_stdio(false);
  7. cin.tie(NULL);
  8.  
  9. int x;
  10. int count = 0;
  11.  
  12. while (cin >> x) {
  13. if (x == 999) {
  14. break;
  15. }
  16. count++;
  17. }
  18.  
  19. cout << count << "\n";
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
0