7406. Beehive Numbers Problem code: BEENUMS
#include<stdio.h>
#include<math.h>
int main()
{
long long int n,d,i;
scanf("%lld",&n);
float k;
while(n!=-1)
{
k=(-3+sqrt(-3+12*n))/6;
d=k;
if(d-k==0)
printf("Y\n");
else
printf("N\n");
scanf("%lld",&n);
}
return 0;
}
#include<stdio.h>
#include<math.h>
int main()
{
long long int n,d,i;
scanf("%lld",&n);
float k;
while(n!=-1)
{
k=(-3+sqrt(-3+12*n))/6;
d=k;
if(d-k==0)
printf("Y\n");
else
printf("N\n");
scanf("%lld",&n);
}
return 0;
}
No comments:
Post a Comment