文章

145

粉丝

143

获赞

21

访问

38.0k

头像
命名法 题解:C
P1854 北京师范大学2019年机试题
发布于2024年3月10日 19:02
阅读数 105

#include <stdio.h>
#include <string.h>

int main()
{
	char s[100];
	while(scanf("%s",s) != EOF)
	{
		char *p = s;
		while(*p)
		{
			if(*p >= 'A' && *p <= 'Z')
			{
				printf("_%c",*p+32);
			}
			else printf("%c",*p);
			p++;
		}
		printf("\n");
	}
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发