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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
| #include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#define n 8
int main()
{
FILE*fp;
FILE*f;
int i,c,z,t,j=11;
char P, *k;
struct Tech
{
char Nomer[3];
char tup[15];
char vutratu[20];
char tusku[20];
char napruga[15];
}
stud[12]={
{"1","AWM1100V","+/-200","+/-0.049","30"},
{"2","AWM 1200V","+/-120","+/-1.01","20"},
{"3","AWM 1300V","-600/+1000","-0.16 +0.34","50"},
{"4","AWM 2100V","+/-200","+/-0.049","30"},
{"5","AWM 2150V","+/-30","+/-0.0053","12"},
{"6","AWM 2200V","+/-120","+/-1.0","20"},
{"7","AWM 2300V","+/-1000","+/-0.34","50"},
{"8","AWM42150VH","+/-25","+/-0.02","8.5"},
{"9","AWM 42300V","+/-1000","+/-0.22","54.7"},
{"10","AWM92100V","+/-200","+/-0.01","77"},
{"11","AWM92100V","+/-5 mbar","+/-0.001","38"},
};
if ((fp=fopen("data_base.txt","w+"))==NULL)
{printf("POMULKA\n");
exit(1);};
for(i=0;i<j;i++)
{
fprintf(fp,"%s\t%s\t%s\t%s\t%s\n",stud[i].Nomer,stud[i].tup,stud[i].vutratu,stud[i].tusku,stud[i].napruga);
};
fclose(fp);
if ((fp=fopen("data_base.txt","rt"))==NULL)
{
printf("Pomulka");
exit(1); }
do
{
printf("Vuberit diyu\n");
printf("1.Pereglyad danuh\n");
printf("2.Zaput\n");
printf("3.Vuhid\n");
scanf("%d",&c);
while(c==1)
{c=0; printf ("\n\t\t\t Davachi vutratu gazy\t\t\t\t\n");
printf (" -------------------------------------------------------------------------\n");
printf(" | Nomer | tup | | vutratu | | tusku | |napruga|\n");
printf( " -------------------------------------------------------------------------\n");
for (i=0;i<j;i++)
{
fscanf(fp,"%s\t%s\t%s\t\t%s\t%s\n",stud[i].Nomer,stud[i].tup,stud[i].vutratu,stud[i].tusku,stud[i].napruga);
printf("\n %s\t %s\t%s \t%s \t%s",stud[i].Nomer,stud[i].tup,stud[i].vutratu,stud[i].tusku,stud[i].napruga);
fclose(fp);
}
if ((fp=fopen("data_base.txt","rt"))==NULL)
{
printf("Pomulka");
exit(1);
};
printf ("\n\n");
printf("\nNatusnit' 1 -- vuitu\n\t 2 -- povtorutu");
scanf("%d",&t); getch();}
while(c==2)
{
c=0;
printf("Vuberit diyu\n");
printf("1.Napruga\n");
printf("2.Nomer\n");
scanf("%d",&z);}
while (z==1)
{ z=0; printf("Vvedit minimalnu vuhidny naprugu=");
scanf("%s",&P);
f=fopen("zaput1.txt","w+");
for (i=0;i<12;i++)
{
fscanf(fp,"%s\t%s\t%s\t%s\t%s\n",stud[i].Nomer,stud[i].tup,stud[i].vutratu,stud[i].tusku,stud[i].napruga);
if (*stud[i].napruga==P)
{
fprintf(f,"%s\t%s\t%s\t%s\t%s\n",stud[i].Nomer,stud[i].tup,stud[i].vutratu,stud[i].tusku,stud[i].napruga);
printf("\n %s\t %s\t%s \t%s \t%s",stud[i].Nomer,stud[i].tup,stud[i].vutratu,stud[i].tusku,stud[i].napruga);
}
}
printf("\nNatusnit' 1 -- vuitu\n\t 2 -- povtorutu");
scanf("%d",&t); getch();}
//------------------------------------------------------------------------------------- work
while (z==2)
{ z=0; printf("Vvedit Nomer\n ");
scanf("%s",&P);
f=fopen("zaput1.txt","w+");
for (i=0;i<12;i++)
{
fscanf(fp,"%s\t%s\t%s\t%s\t%s\n",stud[i].Nomer,stud[i].tup,stud[i].vutratu,stud[i].tusku,stud[i].napruga);
if (*stud[i].Nomer==P)
{
fprintf(f,"%s\t%s\t%s\t%s\t%s\n",stud[i].Nomer,stud[i].tup,stud[i].vutratu,stud[i].tusku,stud[i].napruga);
printf("\n %s\t %s\t%s \t%s \t%s",stud[i].Nomer,stud[i].tup,stud[i].vutratu,stud[i].tusku,stud[i].napruga);
}
}
printf("\nNatusnit' 1 -- vuitu\n\t 2 -- povtorutu");
scanf("%d",&t); getch();}
while(c==3)
{fclose(f); exit(1); }
} while(t==2);
} |