Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <vector>
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int n = 17;
- int a[17];
- int sum_n = 0;
- for (int i = 0; i < n; i++) {
- cin >> a[i];
- if (a[i] % 2 != 0) {
- sum_n = sum_n + a[i];
- }
- }
- for (int i = 0; i < n; i++) {
- if (a[i] % 3 == 0) {
- a[i] = sum_n;
- }
- }
- for (int i = 0; i < n; i++) {
- cout << a[i] << ' ';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement