Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- char a[101],cuv[101][101],*p,separator[]=" ";
- cin.get(a,101);
- p=a;
- p=strtok(p,separator);
- int nr=0;
- while(p)
- strcpy(cuv[++nr],p),p=strtok(NULL,separator);
- char pc='0';
- int poz=0;
- for(int i=1;i<=nr;++i)
- if(isdigit(cuv[i][0])&&cuv[i][0]>pc)
- pc=cuv[i][0],poz=i;
- if(poz)
- cout<<cuv[poz]<<'\n';
- else
- cout<<"nu exista\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement