Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- int N;
- int j, k = 0;
- while (N =! 0)
- {
- std :: cin >> N;
- if (N%2==0)
- {
- for (j = 0; j<5; j++)
- {
- k = k + N;
- N = N + 2;
- }
- }
- else
- {
- N++;
- for (j = 0; j<5; j++)
- {
- k = k + N;
- N = N + 2;
- }
- }
- std :: cout << k << std :: endl;
- k = 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement