nguyentruong98

Untitled

Dec 16th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. for(i = 1; i<=n; i++)
  2.       for(j = 1; j<n; j++)
  3.       {
  4.             if(array2[j] != 2)
  5.             pushStack(s, array1[i]);
  6.             if(j == n-1 && array2[j] != 2)
  7.             {
  8.                   pushStack(s, array1[i]);
  9.                   pushStack(s, array1[i+1]);
  10.             }
  11.             if(array2[j] == 2)
  12.             {
  13.                   cho = array1[i]*array1[i+1];
  14.                   if(array2[j+1] == 2)
  15.                   {
  16.                         cho = cho*array1[i+2];
  17.                         pushStack(s, cho);
  18.                   }
  19.                   if(array2[j+1] != 2)
  20.                   pushStack(s, cho);
  21.             }
  22.       }
Advertisement
Add Comment
Please, Sign In to add comment