C (gcc), (削除) 115 (削除ここまで) (削除) 112 (削除ここまで) (削除) 109 (削除ここまで) (削除) 107 (削除ここまで) 104 bytes
f(n,s,l,p,d)char*s;{d=n<0?-1:1;do for(l=1,p=0;p>=0;p+=l)s[p]?d==l&&putchar(s[p]):l--;while(!n||(n-=d));}
Who said, we need
strlen?
C (gcc), 115 bytes (134 with #include<string.h> in front)
#include<string.h>
f(n,s)char*s;{int l=strlen(s),d=n<0?0:2,m=d--,p;do for(p=m?0:l-1;p!=(m?l:-1);p+=d)putchar(s[p]);while(!n||(n-=d));}
Without
#include<string.h>we get an implicit prototype forstrlenthat returnsint, butstrlenissize_t(at least nowadays, not perfectly sure about k&r or c89, but I believe, it returnedintin the old days).
The missing
#include <stdio.h>isn't a problem, because due to integer promotion, the default prototype will beint putchar(int)which is exactly what we want.
C (gcc), (削除) 115 (削除ここまで) (削除) 112 (削除ここまで) (削除) 109 (削除ここまで) (削除) 107 (削除ここまで) 104 bytes
f(n,s,l,p,d)char*s;{d=n<0?-1:1;do for(l=1,p=0;p>=0;p+=l)s[p]?d==l&&putchar(s[p]):l--;while(!n||(n-=d));}
Who said, we need
strlen?
C (gcc), 115 bytes (134 with #include<string.h> in front)
#include<string.h>
f(n,s)char*s;{int l=strlen(s),d=n<0?0:2,m=d--,p;do for(p=m?0:l-1;p!=(m?l:-1);p+=d)putchar(s[p]);while(!n||(n-=d));}
Without
#include<string.h>we get an implicit prototype forstrlenthat returnsint, butstrlenissize_t(at least nowadays, not perfectly sure about k&r or c89, but I believe, it returnedintin the old days).
The missing
#include <stdio.h>isn't a problem, because due to integer promotion, the default prototype will beint putchar(int)which is exactly what we want.
C (gcc), (削除) 115 (削除ここまで) (削除) 112 (削除ここまで) (削除) 109 (削除ここまで) (削除) 107 (削除ここまで) 104 bytes
f(n,s,l,p,d)char*s;{d=n<0?-1:1;do for(l=1,p=0;p>=0;p+=l)s[p]?d==l&&putchar(s[p]):l--;while(!n||(n-=d));}
Who said, we need
strlen?
C (gcc), 115 bytes (134 with #include<string.h> in front)
#include<string.h>
f(n,s)char*s;{int l=strlen(s),d=n<0?0:2,m=d--,p;do for(p=m?0:l-1;p!=(m?l:-1);p+=d)putchar(s[p]);while(!n||(n-=d));}
Without
#include<string.h>we get an implicit prototype forstrlenthat returnsint, butstrlenissize_t(at least nowadays, not perfectly sure about k&r or c89, but I believe, it returnedintin the old days).The missing
#include <stdio.h>isn't a problem, because due to integer promotion, the default prototype will beint putchar(int)which is exactly what we want.
C (gcc), (削除) 115 (削除ここまで) (削除) 112 (削除ここまで) (削除) 109 (削除ここまで) 107(削除) 107 (削除ここまで) 104 bytes
f(n,s,l,p,d)char*s;{d=n<0?-1:1;do for(l=1,p=0;p>=0;p+=l)s[p]?d==l&&putchar(s[p]):(l=-l)--;while(!n||(n-=d));}
Who said, we need
strlen?
C (gcc), 115 bytes (134 with #include<string.h> in front)
#include<string.h>
f(n,s)char*s;{int l=strlen(s),d=n<0?0:2,m=d--,p;do for(p=m?0:l-1;p!=(m?l:-1);p+=d)putchar(s[p]);while(!n||(n-=d));}
Without
#include<string.h>we get an implicit prototype forstrlenthat returnsint, butstrlenissize_t(at least nowadays, not perfectly sure about k&r or c89, but I believe, it returnedintin the old days).
The missing
#include <stdio.h>isn't a problem, because due to integer promotion, the default prototype will beint putchar(int)which is exactly what we want.
C (gcc), (削除) 115 (削除ここまで) (削除) 112 (削除ここまで) (削除) 109 (削除ここまで) 107 bytes
f(n,s,l,p,d)char*s;{d=n<0?-1:1;do for(l=1,p=0;p>=0;p+=l)s[p]?d==l&&putchar(s[p]):(l=-l);while(!n||(n-=d));}
Who said, we need
strlen?
C (gcc), 115 bytes (134 with #include<string.h> in front)
#include<string.h>
f(n,s)char*s;{int l=strlen(s),d=n<0?0:2,m=d--,p;do for(p=m?0:l-1;p!=(m?l:-1);p+=d)putchar(s[p]);while(!n||(n-=d));}
Without
#include<string.h>we get an implicit prototype forstrlenthat returnsint, butstrlenissize_t(at least nowadays, not perfectly sure about k&r or c89, but I believe, it returnedintin the old days).
The missing
#include <stdio.h>isn't a problem, because due to integer promotion, the default prototype will beint putchar(int)which is exactly what we want.
C (gcc), (削除) 115 (削除ここまで) (削除) 112 (削除ここまで) (削除) 109 (削除ここまで) (削除) 107 (削除ここまで) 104 bytes
f(n,s,l,p,d)char*s;{d=n<0?-1:1;do for(l=1,p=0;p>=0;p+=l)s[p]?d==l&&putchar(s[p]):l--;while(!n||(n-=d));}
Who said, we need
strlen?
C (gcc), 115 bytes (134 with #include<string.h> in front)
#include<string.h>
f(n,s)char*s;{int l=strlen(s),d=n<0?0:2,m=d--,p;do for(p=m?0:l-1;p!=(m?l:-1);p+=d)putchar(s[p]);while(!n||(n-=d));}
Without
#include<string.h>we get an implicit prototype forstrlenthat returnsint, butstrlenissize_t(at least nowadays, not perfectly sure about k&r or c89, but I believe, it returnedintin the old days).
The missing
#include <stdio.h>isn't a problem, because due to integer promotion, the default prototype will beint putchar(int)which is exactly what we want.
C (gcc), (削除) 115 (削除ここまで) 112(削除) 112 (削除ここまで)(削除) 109 (削除ここまで) 107 bytes
f(n,s,l,p,d)char*s;{int l,d=n<0?-1:1,p,c;do1;do for(l=1,p=0;p>=0;p+=l)c=s[p],cs[p]?d==l&&putchar(cs[p]):(l=-l);while(!n||(n-=d));}
Who said, we need
strlen?
C (gcc), 115 bytes (134 with #include<string.h> in front)
#include<string.h>
f(n,s)char*s;{int l=strlen(s),d=n<0?0:2,m=d--,p;do for(p=m?0:l-1;p!=(m?l:-1);p+=d)putchar(s[p]);while(!n||(n-=d));}
Without
#include<string.h>we get an implicit prototype forstrlenthat returnsint, butstrlenissize_t(at least nowadays, not perfectly sure about k&r or c89, but I believe, it returnedintin the old days).
The missing
#include <stdio.h>isn't a problem, because due to integer promotion, the default prototype will beint putchar(int)which is exactly what we want.
C (gcc), (削除) 115 (削除ここまで) 112 bytes
f(n,s)char*s;{int l,d=n<0?-1:1,p,c;do for(l=1,p=0;p>=0;p+=l)c=s[p],c?d==l&&putchar(c):(l=-l);while(!n||(n-=d));}
Who said, we need
strlen?
C (gcc), 115 bytes (134 with #include<string.h> in front)
#include<string.h>
f(n,s)char*s;{int l=strlen(s),d=n<0?0:2,m=d--,p;do for(p=m?0:l-1;p!=(m?l:-1);p+=d)putchar(s[p]);while(!n||(n-=d));}
Without
#include<string.h>we get an implicit prototype forstrlenthat returnsint, butstrlenissize_t(at least nowadays, not perfectly sure about k&r or c89, but I believe, it returnedintin the old days).
The missing
#include <stdio.h>isn't a problem, because due to integer promotion, the default prototype will beint putchar(int)which is exactly what we want.
C (gcc), (削除) 115 (削除ここまで) (削除) 112 (削除ここまで)(削除) 109 (削除ここまで) 107 bytes
f(n,s,l,p,d)char*s;{d=n<0?-1:1;do for(l=1,p=0;p>=0;p+=l)s[p]?d==l&&putchar(s[p]):(l=-l);while(!n||(n-=d));}
Who said, we need
strlen?
C (gcc), 115 bytes (134 with #include<string.h> in front)
#include<string.h>
f(n,s)char*s;{int l=strlen(s),d=n<0?0:2,m=d--,p;do for(p=m?0:l-1;p!=(m?l:-1);p+=d)putchar(s[p]);while(!n||(n-=d));}
Without
#include<string.h>we get an implicit prototype forstrlenthat returnsint, butstrlenissize_t(at least nowadays, not perfectly sure about k&r or c89, but I believe, it returnedintin the old days).
The missing
#include <stdio.h>isn't a problem, because due to integer promotion, the default prototype will beint putchar(int)which is exactly what we want.