标签:main pac image i++ namespace for name acm算法 scan
问题描述:
AC源码:
/**/ #include"iostream" #include"cmath" using namespace std; int main() { int t, n, sq, sum; scanf("%d", &t); for(int i = 0; i < t; i++) { scanf("%d", &n); sum = 1; sq = (int)sqrt(n); for(int j = 2; j <= sq; j++) { if(n % j == 0) { sum += j + n / j; } } if(sq > 1 && sq*sq == n) { sum -= sq; } printf("%d\n", sum); } return 0; }
标签:main pac image i++ namespace for name acm算法 scan
原文地址:http://www.cnblogs.com/forcheng/p/7634897.html