Aktualizovat „du6/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-04-16 07:39:38 +00:00
parent 41776796ca
commit d26f313f9d

View File

@ -9,8 +9,8 @@ Code, Compile, Run and Debug online from anywhere in world.
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <ctype.h> #include <ctype.h>
#define fullSIZE = 1000 #define fullSIZE 1000
#define wSIZE = 100 #define wSIZE 100
#include <string.h> #include <string.h>
int main() int main()
@ -26,14 +26,14 @@ int main()
} }
int pm = 0; int pm = 0;
char** pole_smernikov = malloc(fullSIZE * sizeof(char)); char** pole_smernikov = malloc(fullSIZE * sizeof(char));
char* success[SIZE]; //char* success[SIZE];
char* unsuccess[SIZE]; //char* unsuccess[SIZE];
//memset(pole_smernikov,0,SIZE*sizeof(char*)); //memset(pole_smernikov,0,SIZE*sizeof(char*));
int k = 0; int k = 0;
char* line = malloc(wSIZE * sizeof(char)); char* line = malloc(wSIZE * sizeof(char));
memset(line,0,SIZE); memset(line,0,SIZE);
char* r; //char* r;
int q = 0; //int q = 0;
int pocet_znakov = 0; int pocet_znakov = 0;
while (fgets(line,SIZE,stdin)) { while (fgets(line,SIZE,stdin)) {
pocet_znakov = strlen(line); pocet_znakov = strlen(line);
@ -52,6 +52,7 @@ int main()
} }
k = 0; k = 0;
int i = 0; int i = 0;
i = 0;
while (i < pm){ while (i < pm){
for(int j = 0+1; j < pm-i; j++){ for(int j = 0+1; j < pm-i; j++){
if(0 < strcmp(pole_smernikov[j-1], pole_smernikov[j])){ if(0 < strcmp(pole_smernikov[j-1], pole_smernikov[j])){