Untitled
unknown
plain_text
4 years ago
821 B
2
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[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); }
Editor is loading...