fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. double a, c, d;
  6. cin >> c >> d;
  7. while(cin >> a){
  8. cout <<" "<< a+d <<" ";
  9. d=a;
  10. }
  11. return 0;
  12. }
Success #stdin #stdout 0s 3476KB
stdin
21 -26 21 -28 19 -30 17 -22 15 -24 13 -26
stdout
 -5  -7  -9  -11  -13  -5  -7  -9  -11  -13