refresh
This commit is contained in:
parent
bc79879ba9
commit
2879ee78bd
@ -74,33 +74,25 @@ int search_string (const char* heap_orig, const char* needle_orig) {
|
|||||||
int read_pizza (struct pizza* item) {
|
int read_pizza (struct pizza* item) {
|
||||||
char Line_jeden[LINESIZE]; //название пиццы
|
char Line_jeden[LINESIZE]; //название пиццы
|
||||||
char Line_druha[LINESIZE]; //цена
|
char Line_druha[LINESIZE]; //цена
|
||||||
|
|
||||||
if (fgets(Line_jeden, sizeof(Line_jeden), stdin)==NULL) {
|
if (fgets(Line_jeden, sizeof(Line_jeden), stdin)==NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Line_jeden [strcspn(Line_jeden, "\n")] = '\0';
|
Line_jeden [strcspn(Line_jeden, "\n")] = '\0';
|
||||||
|
|
||||||
if (fgets(Line_druha, sizeof(Line_druha), stdin)==NULL) {
|
if (fgets(Line_druha, sizeof(Line_druha), stdin)==NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Line_druha [strcspn(Line_druha, "\n")] = '\0';
|
Line_druha [strcspn(Line_druha, "\n")] = '\0';
|
||||||
|
|
||||||
float value;
|
float value;
|
||||||
if (sscanf(Line_jeden, "%f", &value ) !=1) {
|
if (sscanf(Line_jeden, "%f", &value ) !=1) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
item->prize = value;
|
item->prize = value;
|
||||||
strcpy(item->name, Line_jeden);
|
strcpy(item->name, Line_jeden);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
|
||||||
int main() {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user