找出任意整数的所有因数。。

太水了太水了,这个题太水了。。。

#include<iostream>
#include<cstdio>
using namespace std;

int main()
{
  int a;
 cin >> a;
 int i;
 for (i=1;i<=a;i++)
 {
     if(a%i==0)
     cout << i << endl ;

 }

    return 0;
}

posted on 2017-02-12 20:01  hanlulu  阅读(135)  评论(0编辑  收藏  举报