Compare commits

...

2 Commits

Author SHA1 Message Date
c0abcbca6e Merge branch 'master' of git.kemt.fei.tuke.sk:ps625sf/pvjc23 2023-04-15 11:12:34 +02:00
bcfd9404f4 . 2023-04-15 11:12:14 +02:00
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;
}