SHARE
TWEET

Untitled

a guest Jan 20th, 2020 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     char s[256],*p,sep[]=" ",nr[101];
  8.     cin.get(s,256); nr[0]='\0';
  9.     p=strtok(s,sep);
  10.     while(p!=NULL)
  11.     {
  12.         if(p[0]>='0'&&p[0]<='9')
  13.             if(nr[0]=='\0')
  14.                 strcpy(nr,p);
  15.             else
  16.                 if(strcmp(nr,p)==-1)
  17.                     strcpy(nr,p);
  18.         p=strtok(NULL,sep);
  19.     }
  20.     if(nr[0]=='\0')
  21.         cout<<"nu exista";
  22.         else cout<<nr;
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top