/* * This simple program is created by Roland Hollós (hollorol@rolandhollos.net) * It is works like this: * ez itt egy nagyon hosszu valtozo == ez_itt_egy_nagyon_hosszu_valtozo_ */ #include #include #include #define MAX_LINE_LEN 10000 int main() { char s[MAX_LINE_LEN]; char out[MAX_LINE_LEN]; while(fgets(s, MAX_LINE_LEN, stdin) != NULL){ int string_length = strlen(s); for(int i = 0; i < string_length; ++i) { /* if((s[i] >= 65) && (s[i] <= 90)) */ if(s[i] == ' '){ out[i] = '_'; continue; } if((s[i] >= 65) && (s[i] <= 90)) { out[i] = s[i] + 32; } out[i] = s[i]; } out[string_length] = '\0'; printf("%s", out); } return 0; }