-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFUN2.h
78 lines (78 loc) · 1.67 KB
/
FUN2.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef __FUN2_H
#define __FUN2_H
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#include"STRINGHEAP.h"
#include"TREENODE.h"
void Fun21(FILE *fdat,Tree *t){
int time,tag;
TreeNode *tmp;
tmp=t->p->sibling->sibling->sibling->child->sibling->child;
system("cls");
PrintString(tmp->data);
scanf("%d",&time);
while(1){
if(time==-1){
break;
}
else if(time==0){
tag=0;
fseek(fdat,12,SEEK_SET);
fwrite(&time,sizeof(int),1,fdat);
fseek(fdat,796,SEEK_SET);
fwrite(&tag,sizeof(int),1,fdat);
PrintString(t->p->data);
}
else if(time>0&&time<=INT_MAX){
tag=1;
fseek(fdat,12,SEEK_SET);
fwrite(&time,sizeof(int),1,fdat);
fseek(fdat,796,SEEK_SET);
fwrite(&tag,sizeof(int),1,fdat);
PrintString(t->p->data);
}
else{
PrintString(t->p->sibling->data);
}
printf("\n\nPress \"enter\" to return\n\n");
fflush(stdin);
getchar();
fflush(stdin);
system("cls");
PrintString(tmp->data);
scanf("%d",&time);
}
return;
}
void Fun22(FILE *fdat,Tree *t){
int map,level;
TreeNode *tmp;
tmp=t->p->sibling->sibling->sibling->child->sibling->child->sibling;
system("cls");
PrintString(tmp->data);
scanf("%d,%d",&map,&level);
while(1){
if(map==-1){
break;
}
else if(map>=1&&map<=5&&level>=1&&level<=10){
fseek(fdat,4,SEEK_SET);
level=(map-1)*10+level;
fwrite(&level,sizeof(int),1,fdat);
PrintString(t->p->data);
}
else{
PrintString(t->p->sibling->data);
}
printf("\n\nPress \"enter\" to return\n\n");
fflush(stdin);
getchar();
fflush(stdin);
system("cls");
PrintString(tmp->data);
scanf("%d,%d",&map,&level);
}
return;
}
#endif