Immer noch WIP. c ist schwer!
This commit is contained in:
parent
8761a5a488
commit
b9b9be6620
45
4/tuer4.c
45
4/tuer4.c
@ -4,20 +4,53 @@
|
||||
|
||||
int main() {
|
||||
FILE *input_file = fopen("./input.txt", "r");;
|
||||
|
||||
fseek(input_file, 0, SEEK_END);
|
||||
int if_size = ftell(input_file);
|
||||
fseek(input_file, 0, SEEK_SET);
|
||||
|
||||
char input[if_size];
|
||||
char c;
|
||||
char c[1];
|
||||
|
||||
int val_arr[4];
|
||||
int pos = 0;
|
||||
char tmp_num[2];
|
||||
int tmp_pos = 0;
|
||||
|
||||
int fully = 0;
|
||||
|
||||
do {
|
||||
c = fgetc(input_file);
|
||||
strncat(input, c, 1);
|
||||
} while(c != (char)-1);
|
||||
c[0] = (char)fgetc(input_file);
|
||||
//if((c[0] == (char)-1)) break;
|
||||
|
||||
printf("%s", input);
|
||||
if(c[0] = '-') {
|
||||
tmp_pos = 0;
|
||||
val_arr[pos] = (int)tmp_num - (int)'0';
|
||||
pos++;
|
||||
break;
|
||||
}
|
||||
if(c[0] = ',') {
|
||||
tmp_pos = 0;
|
||||
val_arr[pos] = (int)tmp_num - (int)'0';
|
||||
pos++;
|
||||
break;
|
||||
}
|
||||
if(c[0] = '\n') {
|
||||
tmp_pos = 0;
|
||||
pos = 0;
|
||||
|
||||
printf("%i; %i; %i; %i\r\n", val_arr[0],val_arr[1],val_arr[2],val_arr[3]);
|
||||
if(val_arr[0]<val_arr[1] && val_arr[2]>val_arr[3]) fully++;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
tmp_num[tmp_pos] = c[0];
|
||||
tmp_pos++;
|
||||
printf("%c",c[0]);
|
||||
} while(c[0] != (char)-1);
|
||||
|
||||
|
||||
printf("~UwU Twying c todayw, awwen't we master? *^w^* Hewe is youww wesult: UmU~ : %i\r\n", fully);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user