Untitled

 avatar
unknown
plain_text
4 years ago
779 B
3
Indexable
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void convert(int a);

int main(void)
{
    char str[100];
    int i = 0;
    printf("Please input a series of numbers separated by space: ");
    char ch = getchar();

    while(ch != '\n'){
        str[i] = ch;
        i++;
        ch = getchar();
    }

    str[i] = '\0';

    int temp[100];
    for(int j = 0; j < strlen(str); j++){
        int i = 0;
        if(str[j] != ' '){
            temp[i] = atoi(str[j]);
            i++;
        }
    }
    int size_arr = sizeof(temp)/sizeof(temp[0]);
    for(int i = 0; i < size_arr; i++){
        int num = temp[i];
        convert(num);
    }


    return 0;
}

void convert(int a){
    int i = a + 96;
    printf("%c", i);
}
Editor is loading...