Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
*Code c++:
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n,x,count=0;
cin>>n>>x;
for (int i=1;i<=n+1;i++)
for (int j=1;j<=n+1;j++)
if (i*j==x) count++;
cout<<count;
}
*Code Pascal:
var i,j:longint;
x,n,d:int64;
begin
read(n,x);
for i:=1 to n+1 do
for j:=1 to n+1 do
if i*j=x then inc(d);
write(d);
end.
Chúc bạn lập trình tốt
Cre:nguyenanh21811 từ nhóm Siêu Cấp
Hãy giúp mọi người biết câu trả lời này thế nào?
$\color{green}{\texttt{C}}\color{lightgreen}{\texttt{+}}\color{lightgreen}{\texttt{+}}$
#include <iostream>
#include <cmath>
#define ll long long
using namespace std;
ll n, x, res;
int main() {
cin >> n >> x;
for (ll i=sqrt(x); i>=1; --i) {
if (x % i == 0) {
if (i <= n && x/i <= n) ++ res;
}
}
cout << 2 * res;
}
$\\$
\begin{array}{c|c|c}\color{#ffd710}{\texttt{\{}} \color{#8655d6}{\texttt{\{}}\ \ \color{#8cdcda}{\text{Daoanhviet96}}\ \ \color{#8655d6}{\texttt{\}}} \color{#ffd710}{\texttt{\}}}\end{array}
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin