poj2410
简单题
View Code
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
//freopen("D:\\t.txt", "r", stdin);
int n;
scanf("%d", &n);
int m = floor(sqrt(n * 2));
int ans = 0;
for (int i = 1; i <= m; i++)
{
if (i % 2 == 0 && n % (i / 2) == 0 && n / (i / 2) % 2 == 1)
ans++;
if (i % 2 == 1 && n % i == 0)
ans++;
}
printf("%d\n", ans);
return 0;
}