SHARE
TWEET

Untitled

a guest Oct 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <fstream>
  2. using namespace std;
  3. ifstream in("numere25.in");
  4. ofstream out("numere25.out");
  5.  
  6. int main()
  7. {
  8.     int x,nr,last = 1;
  9.    
  10.     bool ok = false;
  11.    
  12.     in>>x;
  13.    
  14.     in>>nr;
  15.    
  16.     for(int i=1;i<nr;i++){
  17.         out<<i<<" ";
  18.         ok = true;
  19.     }
  20.    
  21.     last = nr;
  22.    
  23.     while(in>>nr)
  24.     {
  25.         for(int i = last+1;i<nr;i++){
  26.             out<<i<<" ";
  27.             ok = true;
  28.         }
  29.         last = nr;
  30.     }
  31.    
  32.     for(int i = last +1;i<=x;i++){
  33.         out<<i<<" ";
  34.         ok = true;
  35.     }
  36.    
  37.     if(!ok)
  38.         out<<"Nu exista"<<'\n';
  39. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top