Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- void ROT13 (char *s) {
- while (*s!='\0') {
- if ((*s>='a' && *s<='m') || (*s>='A' && *s<='M')) *s+=13;
- else if ((*s>='N' && *s<='Z') || (*s>='n' && *s<='z')) *s-=13;
- s++;
- }}
- int main () {
- printf("Unesite recenicu: ");
- int i=0;
- char recenica[100], c;
- do {
- c=getchar();
- recenica[i]=c;
- i++;
- }
- while (c!='\n' && i<100);
- recenica[i-1]='\0';
- ROT13(recenica);
- printf("Nova recenica: %s",recenica);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement