fork(1) download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a,k,i;
  7.  
  8. for (int i=0; i<10; i++) {
  9.  
  10. cin>>a;
  11. if (a!=0){
  12. a++;
  13. }
  14.  
  15. }
  16. cout<<a;
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 4428KB
stdin
4
3
-5
3
0
5
stdout
10