[ create a new paste ] login | about

Link: http://codepad.org/gplE8hxG    [ raw code | fork ]

C, pasted on Apr 21:
#include<stdio.h>

int Tich(int n)
{
	int S = 0;
	int m = 1;
	while(m < 4)
	{
		for(int i = 1; i <= m * n; ++i)
		{
			S += i;
		}
	 ++m;	
	}	
	return S;
}

int main()
{
	int n;
	do
	{
		printf("\nNhap n di ban:\t");		scanf("%d", &n);
		if(n <= 5)
		{
			printf("Nhap n > 5 ban nhe!");
		}
	}while(n <= 5);
	
	int m;
	
	printf("Tong can tim la:  %d", Tich(n));
	
	
	return 0;
}


Create a new paste based on this one


Comments: