Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
1.0 kB
1
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];
    int condition = 1;
    printf("Input a series of integers separated by a space: ");
    scanf("%[^\n]", num_series);

    num_series[strlen(num_series)] = ' ';
    num_series[strlen(num_series)+1] = '#';
    char temp[10];
    int j=0;
    while(condition == 1){
        for(int i = 0; i < strlen(num_series); i++){
            if(num_series[i] == ' '){
                j = 0;
                num_to_letter(atoi(temp));
            }
            else if (num_series[i] == '#')
            {
                condition = 0;
            }
            else
            {
                temp [j] = num_series[i];
            }
        }
        break;
    }
    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);
}