【Henu ACM Round#18 A】 Multiplication Table

【链接】 我是链接,点我呀:)
【题意】

在这里输入题意

【题解】
遍历i从1..n
看看x%i==0以及x/i<=n是否成立。

【代码】

#include <iostream>

using namespace std;

int main()
{
    int n,x;
    cin >> n >> x;
    int ans = 0;
    for (int i = 1;i <= n;i++)
        if (x%i==0){
            int j = x/i;
            if (j <= n){
                ans++;
            }
        }
    cout<<ans<<endl;
    return 0;
}
posted @ 2018-01-29 11:37  AWCXV  阅读(78)  评论(0编辑  收藏  举报