Skip to main content
smaller
Source Link
girobuz
  • 389
  • 2
  • 8

C (gcc), 225 207 202202 201 bytes

Thanks to ceilingcat for -2324 bytes

#define P strcpy(f+d,index("!?.",i[c-2])+!c? c;d;v(char*ii,int*gg,char*ff)char*i,*g,*f;{for(d=0;i[c];c++,d++)strcmp("[?]",memcpy(g,i+c,3))?f[d]=i[c]:(index("aeiouAEIOU",i[c+4])?P"An ":"an "),d++:P"A ":"a "),d++,c+=3);} 

Try it online!Try it online!

C (gcc), 225 207 202 bytes

Thanks to ceilingcat for -23 bytes

#define P strcpy(f+d,index("!?.",i[c-2])+!c? c;d;v(char*i,int*g,char*f){for(d=0;i[c];c++,d++)strcmp("[?]",memcpy(g,i+c,3))?f[d]=i[c]:(index("aeiouAEIOU",i[c+4])?P"An ":"an "),d++:P"A ":"a "),d++,c+=3);} 

Try it online!

C (gcc), 225 207 202 201 bytes

Thanks to ceilingcat for -24 bytes

#define P strcpy(f+d,index("!?.",i[c-2])+!c? c;d;v(i,g,f)char*i,*g,*f;{for(d=0;i[c];c++,d++)strcmp("[?]",memcpy(g,i+c,3))?f[d]=i[c]:(index("aeiouAEIOU",i[c+4])?P"An ":"an "),d++:P"A ":"a "),d++,c+=3);} 

Try it online!

smaller
Source Link
girobuz
  • 389
  • 2
  • 8

C (gcc), 225 207207 202 bytes

Thanks to ceilingcat for -1823 bytes

#define P strncpystrcpy(f+d,index("!?.",i[c-2])+!c? c;d;v(char*i,int*g,char*f){for(d=0;i[c];c++,d++)strcmp("[?]",memcpy(g,i+c,3))?f[d]=i[c]:(index("aeiouAEIOU",i[c+4])?P"An ":"an ",3),d++:P"A ":"a ",2),d++,c+=3);} 

Try it online!Try it online!

C (gcc), 225 207 bytes

Thanks to ceilingcat for -18 bytes

#define P strncpy(f+d,index("!?.",i[c-2])+!c? c;d;v(char*i,int*g,char*f){for(d=0;i[c];c++,d++)strcmp("[?]",memcpy(g,i+c,3))?f[d]=i[c]:(index("aeiouAEIOU",i[c+4])?P"An ":"an ",3),d++:P"A ":"a ",2),d++,c+=3);} 

Try it online!

C (gcc), 225 207 202 bytes

Thanks to ceilingcat for -23 bytes

#define P strcpy(f+d,index("!?.",i[c-2])+!c? c;d;v(char*i,int*g,char*f){for(d=0;i[c];c++,d++)strcmp("[?]",memcpy(g,i+c,3))?f[d]=i[c]:(index("aeiouAEIOU",i[c+4])?P"An ":"an "),d++:P"A ":"a "),d++,c+=3);} 

Try it online!

smaller
Source Link
girobuz
  • 389
  • 2
  • 8

C (gcc), 225225 207 bytes

Thanks to ceilingcat for -18 bytes

#define P strncpy(f+d,strchrindex("!?.",i[c-2])+!c? vc;d;v(char*i,int*g,char*f){for(int c,d=0;i[c];c++,d++){memcpy(g,i+c,3);if(!strcmp("[?]",memcpy(g,i+c,3)){strchr?f[d]=i[c]:(index("aeiouAEIOU",i[c+4])?P"An ":"an ",3),d++:P"A ":"a ",2),d++;c+=3;}else{f[d]=i[c];}}d++,c+=3);} 

Try it online!

more readable:

Try it online!Try it online!

C (gcc), 225 bytes

#define P strncpy(f+d,strchr("!?.",i[c-2])+!c? v(char*i,int*g,char*f){for(int c,d=0;i[c];c++,d++){memcpy(g,i+c,3);if(!strcmp("[?]",g)){strchr("aeiouAEIOU",i[c+4])?P"An ":"an ",3),d++:P"A ":"a ",2),d++;c+=3;}else{f[d]=i[c];}}} 

Try it online!

more readable:

Try it online!

C (gcc), 225 207 bytes

Thanks to ceilingcat for -18 bytes

#define P strncpy(f+d,index("!?.",i[c-2])+!c? c;d;v(char*i,int*g,char*f){for(d=0;i[c];c++,d++)strcmp("[?]",memcpy(g,i+c,3))?f[d]=i[c]:(index("aeiouAEIOU",i[c+4])?P"An ":"an ",3),d++:P"A ":"a ",2),d++,c+=3);} 

Try it online!

Source Link
girobuz
  • 389
  • 2
  • 8
Loading