Ответ:
#include <iostream>
using namespace std;
int main()
{
int kl = 0,sum=0;
int *a;
a = new int;
for (int i=0;; i++)
cin >> a[i];
if (a[i] == 0) break;
kl++;
}
cout << endl;
cout << a[i] << " ";
if (a[i] > 0 && a[i] % 2 == 0)
sum += a[i];
cout << endl << sum;
Объяснение:
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
#include <iostream>
using namespace std;
int main()
{
int kl = 0,sum=0;
int *a;
a = new int;
for (int i=0;; i++)
{
cin >> a[i];
if (a[i] == 0) break;
kl++;
}
cout << endl;
for (int i=0;; i++)
{
cout << a[i] << " ";
}
for (int i=0;; i++)
{
if (a[i] == 0) break;
if (a[i] > 0 && a[i] % 2 == 0)
{
sum += a[i];
}
}
cout << endl << sum;
}
Объяснение: