Latest topics
» tớ vẫn rất thích cái 4rum này :)by nhokbun_ko0l_9x Wed 08 Jun 2022, 10:43 am
» Phần mềm thống kê R
by votrinhthanhngan Thu 06 Mar 2014, 12:35 pm
» Khai giảng lớp luyện thi N2 và N3 tại Trung tâm Nhật Ngữ Top Globis
by tuquynh Sat 11 Feb 2012, 10:16 am
» kho link torrent các film nổi tiếng cập nhật tới ngày 11-3-09
by changkho297 Sun 27 Nov 2011, 1:34 am
» Tuổi thơ dữ dội - Phùng Quán
by buithainam Fri 14 Oct 2011, 7:19 pm
» Thông báo của lớp trưởng!
by Dâm Sat 08 Oct 2011, 8:33 am
» Hướng dẫn cài đặt và sử dụng các phần mềm chạy Java!!!!
by tiep.coi Fri 07 Oct 2011, 4:30 pm
» K54A3's FOOTBALL TEAM VERSION 2012
by tiep.coi Fri 07 Oct 2011, 4:13 pm
» Thông báo về lịch học Chính trị đợt 2
by Dâm Fri 30 Sep 2011, 10:51 pm
» danh sách bị buộc thôi học
by Dâm Sun 11 Sep 2011, 10:14 pm
bai mau ve cay nhi phan nhi phan cua thay Thong
4 posters
Trang 1 trong tổng số 1 trang
bai mau ve cay nhi phan nhi phan cua thay Thong
moi nguoi doc di thay Thong bao to post len cho moi nguoi xem tham khao
#include
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i printf("\t%d\n",head->key);
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}
#include
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}
meoxu- Tổng số bài gửi : 44
thanks : 0
Join date : 05/09/2010
Re: bai mau ve cay nhi phan nhi phan cua thay Thong
hàm inTree bị thiếu chỗ vòng for ( ) rồi
buithainam- Tổng số bài gửi : 90
thanks : 0
Join date : 25/03/2010
Age : 32
Đến từ : thái bình
Re: bai mau ve cay nhi phan nhi phan cua thay Thong
#include
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i printf("\t%d\n",head->key);
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}#include
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i printf("\t%d\n",head->key);
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}#include
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i printf("\t%d\n",head->key);
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}#include
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i printf("\t%d\n",head->key);
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}#include
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}#include
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}#include
#include
#include
#include
typedef struct node{
int key;
int data;
struct node *left,*right;
} node;
node *nhap(char *filename){
FILE *f;
node **p, *head;
char s[10];
int n,i,j,k;
f = fopen(filename,"r");
fscanf(f,"%d",&n);
k = (int)floor(n/2);
p = (node**)malloc(k*sizeof(node*));
for(i = 1;i<= n;i++){
fflush(stdin);
fscanf(f,"%s ",s);
if(s[0] != 'a'){
node *t = (node*)malloc(sizeof(node));
t->key = i;
t->data = atoi(s);
t->left = NULL;
t->right = NULL;
if(i <= k) p[i] = t;
if(i != 1){
j = (int)floor(i/2);
if(i%2) p[j]->right = t;
else p[j]->left = t;
}else{
head = t;
}
}
}
free(p);
return head;
}
void inTree(node *head,int j){
int i;
if(head){
inTree(head->left,j+1);
for(i = 0;i
inTree(head->right,j+1);
}
}
int main(){
node *head;
head = nhap("data.txt");
inTree(head,0);
getch();
return 0;
}
meoxu- Tổng số bài gửi : 44
thanks : 0
Join date : 05/09/2010
Re: bai mau ve cay nhi phan nhi phan cua thay Thong
Thầy Thông bảo hết chủ nhật mới nộp Hoa nhé.
nqtuan- Tổng số bài gửi : 68
thanks : 5
Join date : 05/04/2010
Đến từ : AcTiViSion
Re: bai mau ve cay nhi phan nhi phan cua thay Thong
Tuần này lại thêm 1 ngày à ??? Hay nhỉ !!!
buithainam- Tổng số bài gửi : 90
thanks : 0
Join date : 25/03/2010
Age : 32
Đến từ : thái bình
Re: bai mau ve cay nhi phan nhi phan cua thay Thong
sao paste nhieu the kia, lay so luong lam thanh` tich ah
luutuan- Tổng số bài gửi : 142
thanks : 6
Join date : 20/04/2010
Age : 32
Re: bai mau ve cay nhi phan nhi phan cua thay Thong
không phải , thiếu nhưng sao không thêm vào được ý mà :))
buithainam- Tổng số bài gửi : 90
thanks : 0
Join date : 25/03/2010
Age : 32
Đến từ : thái bình
Re: bai mau ve cay nhi phan nhi phan cua thay Thong
Tuần này vẫn chủ nhật mới nộp nhé
nqtuan- Tổng số bài gửi : 68
thanks : 5
Join date : 05/04/2010
Đến từ : AcTiViSion
Similar topics
» Phần mềm thống kê R
» Thông Báo Phương Trình Vi Phân
» Về việc thay đổi mặt cười
» M thấy có trang này rất ý nghĩa muốn giới thiệu cho các bạn cùng đọc. :-)
» Phần mềm vẽ đồ thị ...
» Thông Báo Phương Trình Vi Phân
» Về việc thay đổi mặt cười
» M thấy có trang này rất ý nghĩa muốn giới thiệu cho các bạn cùng đọc. :-)
» Phần mềm vẽ đồ thị ...
Trang 1 trong tổng số 1 trang
Permissions in this forum:
Bạn không có quyền trả lời bài viết
|
|