Ma ajuta cineva cu ex 2 a . b ? Multumesc mult de tot

Răspuns:
2.a
#include <iostream>
using namespace std;
int main()
{unsigned int n,i;
int x,s=0;
cin>>n;
for (i=1;i<=n;i++)
{cin>>x;
if (x%2==0)
s=s+x;}
cout<<"Suma numerelor pare este: "<<s;
return 0;
}
2.b
#include <iostream>
using namespace std;
int main()
{unsigned int n,i;
cin>>n;
for (i=1;i<=n;i++)
{if (i*i<n)
cout<<i*i<<' ';}
return 0;
}