[ create a new paste ] login | about

Link: http://codepad.org/LsH7ZQia    [ raw code | output | fork | 8 comments ]

C, pasted on Aug 20:
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
	int i, n;
	float S;
	do
	{
		printf("\nNhap n(n >= 1): ");
		scanf("%d", &n);

		if(n < 1)
		{
			printf("\nn phai >= 1. Xin nhap lai !");
		}
	}while(n < 1);
	i = 1;
	S = pow(1.0, 1.0/2);
	while(i <= n)
	{
		S = pow((i + S) * 1.0, 1.0/(i + 1));
		i++;
	}
	printf("\nTong la %f", S);

	getch();
	return 0;
}


Output:
1
Line 17: error: conio.h: No such file or directory


Create a new paste based on this one


Comments:
posted by yonnon on Jul 5
khó quá
reply
posted by yonnon on Jul 5
nhưng phải cố

reply
posted by yonnon on Jul 5
cái gì mà khó kinh khủng dạ ta :))

reply
posted by yonnon on Jul 5
nhức đầu ghê á
reply
posted by yonnon on Jul 5
thua
reply
posted by cuong.luucb8921 on Aug 19
#include<stdio.h>

int main(){
int i;
int n;
float s=0;
do
{
printf("Nhap vap n:\n");
scanf("%d",&n);
if(n < 1)
{
printf("n phai lon hon bang 1\n");
}
}while(n < 1);

for(i=1;i<=n;i++)
{
s = pow(s+i, 1.0/(i+1));
}
printf("sum = %f",s);
return 0;
}

reply
posted by minhtampro195@gmail.com on Feb 5
float BAI_38(int n)
{
if(n == 1)
return 1;
else
{
return pow(n + (BAI_38(n - 1)), (float)1 / (n + 1));
}
}
reply
posted by quan01 on Feb 22
Ai giải thích cho mình phần
S = pow(1.0, 1.0/2); ko ak
reply