5297. Family Problems Problem code: FAMILYP
#include<stdio.h>
#include<math.h>
int main()
{
long long int N;
int ans;
float n;
char c;
while((scanf("%lld",&N)) !=EOF)
{
n=-1+sqrt(1+8*N);
n=n/2;
long k;
k=ceil(n);
ans=k%27-1;
printf("TERM %lld IS %c\n",N,65+ans);
}
return 0;
}
#include<stdio.h>
#include<math.h>
int main()
{
long long int N;
int ans;
float n;
char c;
while((scanf("%lld",&N)) !=EOF)
{
n=-1+sqrt(1+8*N);
n=n/2;
long k;
k=ceil(n);
ans=k%27-1;
printf("TERM %lld IS %c\n",N,65+ans);
}
return 0;
}
No comments:
Post a Comment