Advertisement
Guest User

bac

a guest
Jan 28th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. int main()
  5. {
  6.     unsigned n,a[100],i=0,ok=0;
  7.     ifstream fin("bac.txt");
  8.     cout<<"n=";cin>>n;
  9.     while(!fin.eof())
  10.     {
  11.         fin>>a[i++];
  12.     }
  13.     for(int i=0;i<n;i++)
  14.         if(a[i]%n==0)
  15.         {
  16.             ok=1;
  17.             cout<<a[i]<<" ";
  18.         }
  19.         if(ok==0)
  20.             cout<<"Nu exista";
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement