You are on page 1of 2

3662

#include <iostream>

using namespace std;

int main()

long long n,c,s=0,k=0;

cin>>n;

while(n!=0)

c=n%10;

s=s+c;

n=n/10;

while(s!=0)

k++;

s=s/10;

cout<<k;

return 0;

3665

#include <iostream>

using namespace std;

int main()
{int n,c,cmax=0;

cin>>n;

while(n!=0)

c=n%10;

if(c%2==0&&c>cmax)cmax=c;

n=n/10;

if(cmax==0)

cout<<-10;

cout<<cmax;

return 0;}

3620

#include <iostream>

using namespace std;

int main()

{long long n,k,c,a=0;

cin>>n>>k;

while(n!=0)

c=n%10;

if(c>k)a=1;

n=n/10;

if(a==1)

cout<<"NU";

else cout<<"DA";

return 0;}

You might also like