You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Test_C/2.10.txt

23 lines
472 B

#include <stdio.h>
int lower(int c);
int main()
{
int i;
char s[] = "DEERTGAD UIOG\0";
printf("s = %s\n", s);
printf("lower s = ");
for (i = 0; s[i] != '\0'; i++)
printf("%c", lower(s[i]));
printf("\n");
return 0;
}
/* lower: преобразование прописных c в строчные, только для ASCII */
int lower(int c)
{
return (c >= 'A' && c <='Z') ? c +'a'-'A' : c;