Problema 1.
#include <iostream>
using namespace std;
int main()
{
int n, suma=0, x;
cin>>n;
while(n!=0)
{
cin>>x;
if(x%3==0)
suma=suma+x;
n=n-1;
}
cout<<suma;
return 0;
}
Problema 2.
#include <iostream>
using namespace std;
int main()
{
int n, i=1;
cin>>n;
while(i<=n)
{
cout<<i<<" ";
i++;
}
return 0;
}