Advertisement
idsystems

CPP_Practica62_Divisores

Mar 13th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. // Program: divisores.cc
  2. // Author:  Yoan Pinzon
  3. // Date:    Agosto 30, 2006
  4.  
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. int main(){
  10.    int n;
  11.  
  12.    cout << "Entre n: "; cin >> n;
  13.    cout << "Los divisores de " << n << " son ";
  14.    for(int i=1; i<=n; i++) if(!(n%i)) cout << i << " ";
  15.  
  16.    return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement