Guest User

zap0

a guest
Jun 17th, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.  for (int i=1;i<9;i++)
  9.  {
  10.     cout<<" ";
  11.        static int j=0;
  12.     if (i==1 || (i%2==0)){
  13.         if (i!=1) cout<<i;  //print i before j
  14.         cout<<" "<<j--<<" ";
  15.         if (i==1) cout<<i;  //print i after j
  16.         continue;   //skip this loop
  17.     }
  18.     cout<<i;
  19.    
  20.    
  21.  }
  22.     cout<<endl;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment