Advertisement
CMatchelo

Untitled

Nov 23rd, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int N;
  6. int j, k = 0;
  7.  
  8. while (N =! 0)
  9. {
  10. std :: cin >> N;
  11.  
  12. if (N%2==0)
  13. {
  14. for (j = 0; j<5; j++)
  15. {
  16. k = k + N;
  17. N = N + 2;
  18. }
  19. }
  20. else
  21. {
  22. N++;
  23. for (j = 0; j<5; j++)
  24. {
  25. k = k + N;
  26. N = N + 2;
  27. }
  28. }
  29.  
  30. std :: cout << k << std :: endl;
  31. k = 0;
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement