Untitled

mail@pastecode.io avatar
unknown
c_cpp
3 years ago
608 B
2
Indexable
Never
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void num_to_letter(int a);

int main(void)
{
    int stu_id = 70357003;
    char num_series[100];
    printf("Input a series of integers separated by a space: ");
    scanf("%[^\n]", num_series);

    for(int i = 0; i < strlen(num_series); i++){
        if(num_series[i] == ' '){
            continue;
            }
        else{
            num_to_letter((num_series[i])-'0');
            }
        }
    printf("\n\nStudent ID: %d\n\n", stu_id);
    return 0;
}

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