Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, i, k, uc, cmax;
- cout<<"Cate numere doriti sa se citeasca??"<<endl;
- cin>>k;
- for(i=1; i<=k; i++)
- {
- cout<<"n="<<endl; cin>>n;
- uc=n%10;
- cmax=uc;
- while(n!=0)
- {
- n=n%10;
- if(uc>cmax)
- cmax=uc;
- n=n/10;
- cout<<"Cifra maxima este:"<<cmax<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement