Advertisement
nicuvlad76

Untitled

Nov 13th, 2020
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include <fstream>
  4. #define N 301
  5. using namespace std;
  6. char s[N], pmax[N];
  7. bool ok;
  8.  
  9.  
  10. void Citire()
  11. {
  12.     ifstream cin("date.in");
  13.    while(cin>>s)
  14.    {
  15.        if(s[0]>='0'&&s[0]<='9')
  16.        {
  17.            if(ok==0) strcpy(pmax,s);
  18.            else
  19.              if(strcmp(pmax,s)<0)strcpy(pmax,s);
  20.          ok=1;
  21.        }
  22.    }
  23.    if(ok!=0)cout<<pmax;
  24.    else cout<<"nu exista";
  25. }
  26.  
  27. int main()
  28. {
  29.    Citire();
  30.     return 0;
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement