Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n, c, s = 0, p = 1;
cin>> n;
while(n != 0){
c = n % 10;
n = n / 10;
if(c >= 3) s = s + c;
if(c > 0) p = p * c;
}
cout<< s<< ' '<< p;
return 0;
Explicație:
Show life that you have a thousand reasons to smile
© Copyright 2024 DOKU.TIPS - All rights reserved.
Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n, c, s = 0, p = 1;
cin>> n;
while(n != 0){
c = n % 10;
n = n / 10;
if(c >= 3) s = s + c;
if(c > 0) p = p * c;
}
cout<< s<< ' '<< p;
return 0;
}
Explicație: