Facebook
From Beefy Mosquito, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 198
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. int main() {
  5.  int d[6];
  6.  int l;
  7.  long int NWD;
  8.  fstream plik;
  9.  plik.open("liczby.txt");
  10.  if (!plik.good())
  11.   cout<<"brak pliku!";
  12. plik>>l;
  13. d[0]=l;
  14.  for(int i=1;i<=d[0];i++){
  15.         if(d[0]%i==0)
  16.         cout<<i<<" ";
  17.  }
  18.  return 0;
  19. }