Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
926 B
1
Indexable
Never
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void convert(int a)
int main(void)
{
     int i = 0;
     char str[100];
     printf("Please enter a series of numbers separated by a space: ");
     char ch = getchar();
     while (ch != '\n')
     {
         str[i] = ch;
         i++;
         ch = getchar();
     }
     str[i] = ' ';
     str[i + 1] = '\0';
     char temp[10];
     i = 0;
     for (int j = 0;j<strlen(str); j++)
     {
         if (str[j] != ' ')
         {
             temp[i] = str[j];
             i++;
         }
         else
             {
             int num = atoi(temp);
             convert(num);
             for (i = 0; i<10; i++)
             {
                temp[i] = ' ';
             }
             i = 0;
         }
     }
     printf("\nSY2002103");
}

void convert(int num)
{
     int a = num + 96;
     printf("%c", a);
}