hopingsteam

Untitled

Feb 8th, 2020
116
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include    <iostream>
  2. #include    <fstream>
  3.  
  4. using namespace std;
  5.  
  6. ifstream fin("numere.in");
  7.  
  8. int main()
  9. {
  10.     int n,nr=0;
  11.     while(fin >> n)
  12.     {
  13.         //cout << "Numerele sunt: " << n << "\n";
  14.         if(n%3-1==0) {
  15.             cout << n << " ";
  16.             nr++;
  17.         }
  18.     }
  19.     if(nr==0)
  20.     {
  21.         cout<<"Nu exista";
  22.     }
  23.     return 0;
  24. }
RAW Paste Data