3215768_ac_16ms_176k.c

来自「北大大牛代码 1240道题的原代码 超级权威」· C语言 代码 · 共 55 行

C
55
字号
#include <stdio.h>
#include <ctype.h>

char str[501];

void output(int st,int ed)
{
	int i;

	for(i = st; i < ed; i++)
	{
		putchar(str[i]);
	}
	puts("");
}

int main()
{
	int i, j;

	scanf("%s",str);
	for(i = 2; str[i]; i++)
	{
		if(str[i]=='@'||str[i]=='#'||str[i]=='&')
		{
			j = i+2;
			while(str[j]&&isdigit(str[j]))
				j++;
			if(str[j]=='=')
			{
				j++;
				while(str[j]&&isdigit(str[j]))
					j++;
			}
			output(i,j);
			i = j-1;
			continue;
		}
		if(isupper(str[i+1]))
			j = i+2;
		else
			j = i+1;
		while(str[j]&&isdigit(str[j]))
			j++;
		if(str[j]=='=')
		{
			j++;
			while(str[j]&&isdigit(str[j]))
				j++;
		}
		output(i,j);
		i = j-1;
	}
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?