Răspuns :
a)
#include<iostream>
using namespace std;
int main(){
int x, sdp=0;
cin>>x;
while(x!=0){
int s=0;
for(int i=1;i<=x;i++) if(x%i==0) s+=i;
if(s%2==0) sdp++;
cin>>x;
}
cout<<sdp;
return 0;
}
b)
#include<iostream>
using namespace std;
int main(){
int x, nr1=0, v[101], i=1;
cin>>x;
while(x!=0){
int k=0, cx=x;
while(cx!=0) if(cx%10==1) k++;
if(k==3) v[i++]=x;
cin>>x;
}
for(int j=1;j<=i-1;j++) cout<<v[j]<<' ';
return 0;
}
c)
#include<iostream>
using namespace std;
int main(){
int x, y;
cin>>x;
if(x==0) {cout<<"nu avem nr"; return 0;}
while(x!=0){
cin>>y;
if(x>y&&y!=0) {cout<<"nu"; return 0;}
x=y;
}
cout<<"da";
return 0;
}
d)
#include<iostream>
using namespace std;
int main(){
int x, k, nr=0, v[1001], i=1;
cin>>k>>x;
while(x!=0) {
if(((x%10)%k)==0) v[i++]=x;
cin>>x;
}
for(int j=1;j<=i-1;j++) cout<<v[j]<<' ';
return 0;
}
e)
#include<iostream>
using namespace std;
int main(){
int x, y, max, v[1001], i=1, k=0;
cin>>x;
if(x==0) {cout<<"nu avem nr"; return 0;}
max=x;
v[i++]=x;
while(x!=0){
cin>>y;
if(max>y&&y!=0) max=y;
v[i++]=y;
x=y;
}
for(int j=1;j<=i-1;j++) if(max==v[j]) k++;
cout<<max<<", "<<k;
return 0;
}