a)
#include<iostream>
using namespace std;
int main(){
int n, max=0;
cin>>n;
do{
n/=10;
if(max<n%10) max=n%10;
}while(n!=0);
cout max;
return 0;
}
b)
citeste n
max<-0
n<-[n/10]
|-daca max<n%10 atunci
| max<-n%10
|-
|-daca n!=0 atunci
| |-cat timp n!=0 executa
| | n<-[n/10]
| | |-daca max<n%10 atunci
| | | max<-n%10
| | |-
| |-
|-
scrie max