Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <limits.h>
- using namespace std;
- int main()
- {
- int n,k=0,m,cif,a[100],b[100];
- cout<<"n=";
- cin>>n;
- for (int i=1; i<=n; i++)
- {
- m=INT_MIN;
- cout<<"a=";
- cin>>a[i];
- while (a[i])
- {
- cif=a[i]%10;
- a[i]/=10;
- if (m<cif)
- m=cif;
- }
- b[k++]=m;
- }
- for (int i=0; i<k; i++)
- cout<<b[i]<<" ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement