#include #define MAXN 21 /* deklaracija funkcije - samo njen potpis zbog preglednost u ovom slucaju */ int ucitaj(char s[]); int main(){ char s[MAXN]; int n; //scanf nam ne radi posao jer ucitava samo rec //scanf("%s", s); n = ucitaj(s); if(n==-1){ printf("-1\n"); return 1; } printf("%s\n", s); return 0; } int ucitaj(char s[]){ char c; int i=0; while((c=getchar())!='\n'){ if(i>=MAXN-1) return -1; s[i++]=c; } s[i]='\0'; return i; }