1
PROGRAMUL TAU ESTE GRESIT DE PROFESOR!!! LA FINAL TREBUIE cout<<p; NU cout<<s;
a) calculeaza produsul cifrelor unui numar
b) 4*3*2*1=24
c) 15 SAU 35
d)
#include<iostream>
using namespace std;
int main(){
int p=1,n;
cin>>n;
while(n!=0){
if(n%10%2==1)
p*=(n%10);
n/=10;
}
cout<<p;
return 0;
}
2.
#include<iostream>
using namespace std;
int main(){
int n,x,k=0;
cin>>n;
do{
if(n%10==x)
k++;
n/=10;
}while(n!=0);
cout<<k;
return 0;
}
3.
#include<iostream>
using namespace std;
int main(){
float l;
cin>>l;
cout<<l*l<<' '<<4*l;
return 0;
}
4.
#include<iostream>
using namespace std;
int main(){
int a,b,c,min;
cin>>a>>b>>c;
min=a;
if(min<b)
min=b;
if(min<c)
min=c;
cout<<min;
return 0;
}