Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenni-Foued committed Oct 27, 2020
1 parent 3dedb05 commit dcbc8ca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions print_rot13.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "holberton.h"
#include <stdarg.h>
#include <stdlib.h>
/**
* print_rot13 - Prints a string in rot13.
* @arg: String address.
Expand All @@ -8,13 +9,16 @@
int print_rot13(va_list arg)
{
int i, j, count = 0;
char a[] = "AaBbCcDdEeFfGgHhIiJjKkLlMm";
char b[] = "NnOoPpQqRrSsTtUuVvWwXxYyZz";
char a[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
char b[] = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm";
char *s = va_arg(arg, char *);

if (!s)
s = "empty";

for (i = 0; s[i]; i++)
{
for (j = 0; j < 26; j++)
for (j = 0; j < 52; j++)
{
if (s[i] == a[j])
{
Expand Down

0 comments on commit dcbc8ca

Please sign in to comment.