Post History
C (clang), 161 bytes i,j,k;main(){char *s;scanf("%i%[^\n]%*c",&i,s);for(j=0;j<strlen(s);j++){if(isalpha(s[j])){for(k=0;k<i;k++){if(s[j]==90||s[j]==122){s[j]-=26;}s[j]+=1;}}}puts(s);} ...
Answer
#3: Post edited
- # [C (clang)], 161 bytes
- <!-- language-all: lang-c -->
- i,j,k;main(){char *s;scanf("%i%[^\n]%*c",&i,s);for(j=0;j<strlen(s);j++){if(isalpha(s[j])){for(k=0;k<i;k++){if(s[j]==90||s[j]==122){s[j]-=26;}s[j]+=1;}}}puts(s);}
- [Try it online!][TIO-krncke5z]
Sorry if I made this even earlier. I did this while waiting for enough advice 'til I can post the challenge.- [C (clang)]: http://clang.llvm.org/
- [TIO-krncke5z]: https://tio.run/##VYzBjoIwFEX3fkXjhEkrOFEWmkmtP@I4Sa3QvhYfhGLCiP12hkYXujs59@Sqpaok6vEDUFXXc0F2vjtD/WX2s1fVAup3p7q/ppjUCJnNHL9IQMoGZWRLFp57JbGk8wSSw@8PHpOFmmefkHnGy7qlVqy4ja9VgXRyNk3ZACUFL6vGSOoP9sjYEFM3pW4H3D2TOAnxvbrfH7TOczZEXIp8w0OkVKx5CKG5dj6eh3Hc6r7uHbkZrTtyO9U9aQ0ShH8 "C (clang) – Try It Online"
- # [C (clang)], 161 bytes
- <!-- language-all: lang-c -->
- i,j,k;main(){char *s;scanf("%i%[^\n]%*c",&i,s);for(j=0;j<strlen(s);j++){if(isalpha(s[j])){for(k=0;k<i;k++){if(s[j]==90||s[j]==122){s[j]-=26;}s[j]+=1;}}}puts(s);}
- [Try it online!][TIO-krncke5z]
- [C (clang)]: http://clang.llvm.org/
- [TIO-krncke5z]: https://tio.run/##VYzBjoIwFEX3fkXjhEkrOFEWmkmtP@I4Sa3QvhYfhGLCiP12hkYXujs59@Sqpaok6vEDUFXXc0F2vjtD/WX2s1fVAup3p7q/ppjUCJnNHL9IQMoGZWRLFp57JbGk8wSSw@8PHpOFmmefkHnGy7qlVqy4ja9VgXRyNk3ZACUFL6vGSOoP9sjYEFM3pW4H3D2TOAnxvbrfH7TOczZEXIp8w0OkVKx5CKG5dj6eh3Hc6r7uHbkZrTtyO9U9aQ0ShH8 "C (clang) – Try It Online"
#2: Post edited
- # [C (clang)], 161 bytes
- <!-- language-all: lang-c -->
- i,j,k;main(){char *s;scanf("%i%[^\n]%*c",&i,s);for(j=0;j<strlen(s);j++){if(isalpha(s[j])){for(k=0;k<i;k++){if(s[j]==90||s[j]==122){s[j]-=26;}s[j]+=1;}}}puts(s);}
- [Try it online!][TIO-krncke5z]
- [C (clang)]: http://clang.llvm.org/
- [TIO-krncke5z]: https://tio.run/##VYzBjoIwFEX3fkXjhEkrOFEWmkmtP@I4Sa3QvhYfhGLCiP12hkYXujs59@Sqpaok6vEDUFXXc0F2vjtD/WX2s1fVAup3p7q/ppjUCJnNHL9IQMoGZWRLFp57JbGk8wSSw@8PHpOFmmefkHnGy7qlVqy4ja9VgXRyNk3ZACUFL6vGSOoP9sjYEFM3pW4H3D2TOAnxvbrfH7TOczZEXIp8w0OkVKx5CKG5dj6eh3Hc6r7uHbkZrTtyO9U9aQ0ShH8 "C (clang) – Try It Online"
- # [C (clang)], 161 bytes
- <!-- language-all: lang-c -->
- i,j,k;main(){char *s;scanf("%i%[^\n]%*c",&i,s);for(j=0;j<strlen(s);j++){if(isalpha(s[j])){for(k=0;k<i;k++){if(s[j]==90||s[j]==122){s[j]-=26;}s[j]+=1;}}}puts(s);}
- [Try it online!][TIO-krncke5z]
- Sorry if I made this even earlier. I did this while waiting for enough advice 'til I can post the challenge.
- [C (clang)]: http://clang.llvm.org/
- [TIO-krncke5z]: https://tio.run/##VYzBjoIwFEX3fkXjhEkrOFEWmkmtP@I4Sa3QvhYfhGLCiP12hkYXujs59@Sqpaok6vEDUFXXc0F2vjtD/WX2s1fVAup3p7q/ppjUCJnNHL9IQMoGZWRLFp57JbGk8wSSw@8PHpOFmmefkHnGy7qlVqy4ja9VgXRyNk3ZACUFL6vGSOoP9sjYEFM3pW4H3D2TOAnxvbrfH7TOczZEXIp8w0OkVKx5CKG5dj6eh3Hc6r7uHbkZrTtyO9U9aQ0ShH8 "C (clang) – Try It Online"
#1: Initial revision
# [C (clang)], 161 bytes <!-- language-all: lang-c --> i,j,k;main(){char *s;scanf("%i%[^\n]%*c",&i,s);for(j=0;j<strlen(s);j++){if(isalpha(s[j])){for(k=0;k<i;k++){if(s[j]==90||s[j]==122){s[j]-=26;}s[j]+=1;}}}puts(s);} [Try it online!][TIO-krncke5z] [C (clang)]: http://clang.llvm.org/ [TIO-krncke5z]: https://tio.run/##VYzBjoIwFEX3fkXjhEkrOFEWmkmtP@I4Sa3QvhYfhGLCiP12hkYXujs59@Sqpaok6vEDUFXXc0F2vjtD/WX2s1fVAup3p7q/ppjUCJnNHL9IQMoGZWRLFp57JbGk8wSSw@8PHpOFmmefkHnGy7qlVqy4ja9VgXRyNk3ZACUFL6vGSOoP9sjYEFM3pW4H3D2TOAnxvbrfH7TOczZEXIp8w0OkVKx5CKG5dj6eh3Hc6r7uHbkZrTtyO9U9aQ0ShH8 "C (clang) – Try It Online"