Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
32
13
⊕hình chữ nhật:
code:
#include <bits/stdc++.h>
using namespace std;
bool KTSNT(long long x)
{
if(x<2)
return false;
for(int i=2; i<=sqrt(x); i++)
if(x%i==0)
return false;
return true;
}
int main()
{
long long n;
cin>>n;
if(KTSNT(n)==true)
cout<<"YES";
else
cout<<"NO";
cout<<endl;
}
⊕hình vuông:
code:
#include <bits/stdc++.h>
using namespace std;
long long v(long long a)
{
return a*a;
}
int main()
{
long long a;
cin>>a;
cout<<v(a);
}
⊕hình tròn:
code:
#include <bits/stdc++.h>
using namespace std;
long long tr(long long r)
{
return r*r*3.14;
}
int main()
{
long long a;
cin>>a;
cout<<tr(r);
}
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin