Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n,cmax=-1;
cin>>n;
while(n!=0)
if(n%10>cmax)
cmax=n%10;
n=n/10;
}
cout<<cmax;
return 0;
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,cmax=-1;
cin>>n;
while(n!=0)
{
if(n%10>cmax)
cmax=n%10;
n=n/10;
}
cout<<cmax;
return 0;
}