Aktualizovat a3/program.c
This commit is contained in:
parent
53aca87429
commit
1a9506f747
52
a3/program.c
52
a3/program.c
@ -1,6 +1,54 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#DEFINE BUFFER_SIZE 64;
|
||||||
|
#DEFINE STUDENT_SIZE 32;
|
||||||
|
|
||||||
|
struct studentApplication
|
||||||
|
{
|
||||||
|
char meno[BUFFER_SIZE];
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int studentsAmount;
|
||||||
|
struct studentsApplication student[STUDENT_SIZE];
|
||||||
|
int i = 0;
|
||||||
|
char processedName[BUFFER_SIZE];
|
||||||
|
|
||||||
|
setMemoryOfArrays(processedName, student);
|
||||||
|
|
||||||
|
while (fgets(line, SIZE, stdin) != NULL)
|
||||||
|
{
|
||||||
|
if (studentsAmount == 0)
|
||||||
|
{
|
||||||
|
if(sscanf(line, "%d", studentsAmount) == 1) { continue; }
|
||||||
|
}
|
||||||
|
else if(sscanf(line, "%s", processedName) == 1)
|
||||||
|
{
|
||||||
|
strcpy(student[i].meno, processedName);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (studentsAmount == 0)
|
||||||
|
{
|
||||||
|
puts("Nespravny vstup");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
void setMemoryOfArrays(char* processedName, studentsApplication* student)
|
||||||
|
{
|
||||||
|
//prednastavi pamat mnozinovych premien
|
||||||
|
processedName[0] = '\0';
|
||||||
|
|
||||||
|
for (int i = 0; i++; i < STUDENT_SIZE)
|
||||||
|
{
|
||||||
|
student[i].meno = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user