[ create a new paste ] login | about

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

C, pasted on Sep 14:
#include<stdio.h>
#include<conio.h>

int main()
{
	int i, j, m, n;

	printf("\nNhap m: ");
	scanf("%d", &m);

	// Câu a
	printf("\nNhap n: ");
	scanf("%d", &n);

	for(i = 1; i <= m; ++i)
	{
		for(j = 1; j <= n; ++j) 
		{
			printf("*");
		}
		printf("\n"); //xuong dong khi in xong 1 hang 
	}

	printf( "\n" );

	for(i = 1; i <= m; ++i)
	{
		for(j = 1; j <= n; ++j) 
		{
			if( i == 1 || i == m || j == 1 || j == n )
			{
				printf("*");
				if(j == n)
				printf( "\n" );
			}
			else
				printf(" "); 
		}
	}
	getch();
	return 0;
}


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


Create a new paste based on this one


Comments: