My Opera is closing 1st of March

you made create the future!!!

bai tap lap trinh c++

Bài 1 : Lập bảng cửu chương


CODE
#include "stdio.h"
#include "conio.h"
#include "math.h"
/* Lap bang cuu chuong
main()
{
int n;
int i;
for (n=1;n<=9;++n)
{ for (i=1;i<=9;++i)
printf("\n%dx%d=%d",n,i,n*i);
printf("\n");
}

getch();
}
Bài 2 : Tìm số nguyên tồ->n

/* Tim so nguyen to toi n
CACH 1
main()
{
int n;
printf("Nhap n :");
scanf("%d",&n);
int i,j;
bool nt;
for (i=2;i<=n;++i)
{
nt=true;
for (j=2;j<=i-1;++j)
{
if (i%j ==0)
nt=false;
}
if (nt==true)
printf("\n%d",i);
}
getch();
}
*/
CACH 2
int daxoa[30001] = {1,1,0};
for (i=2;i<=n;i++)
if (daxoa==0)
for (j=i+i;j<=n;j=j+i)
daxoa[j] = 1;
for (i=0;i<=n;i++)
if (daxoa==0)
printf("%d ",i);




bai 3

Write a comment

New comments have been disabled for this post.

February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28