Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. int f(int* pnBuffer, int nSize, int nIndex)
  2. {
  3. int nSum = 0;
  4. for(int i = 0; i < nSize; i++)
  5. {
  6. if(i == nIndex)
  7. {
  8. nSum += pnBuffer[i];
  9. nSum += pnBuffer[nSize - i - 1];
  10. nIndex *= nIndex;
  11. }
  12. }
  13. return nSum;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement