This commit is contained in:
Patrik Seman 2023-04-15 11:12:14 +02:00
parent bd3bbb3219
commit bcfd9404f4
2 changed files with 25 additions and 0 deletions

BIN
du6/program Executable file

Binary file not shown.

25
du6/program.c Normal file
View File

@ -0,0 +1,25 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
int pocet=0;
char mena[50][50];
char riadok[50];
int pocet_mien=0;
scanf("%d\n", &pocet);
while(fgets(riadok,50,stdin)!=NULL && riadok[0]!='\n'){
if(riadok[strlen(riadok)-1]=='\n'){
riadok[strlen(riadok)-1]='\0';
}
strcpy(mena[pocet_mien],riadok);
pocet_mien++ ;
}
for(int i=0; i<pocet_mien; i++){
printf("%s\n", mena[i]);
}
return 0;
}