fork download
  1. $sum = 0;
  2. $counter = 0;
  3. $x = <STDIN>;
  4. while ( $x ne "end")
  5. {
  6. $sum += $x ;
  7. $x = <STDIN>;
  8. $counter ++;
  9.  
  10. }
  11. print $sum;
Success #stdin #stdout 0s 18256KB
stdin
1
2
3
end
stdout
6