Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
821 B
0
Indexable
Never
#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[10];
    for(int j = 0; j < strlen(str); j++){
        int i = 0;
        if(str[j] != ' '){
            temp[i] = str[j];
            i++;
        }
        else{
            int num = atoi(temp);
            convert(num);
            for(int i = 0; i < 10; i++){
                temp[i] = ' ';
            }
            i = 0;
        }
    }

    return 0;
}

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