Giter VIP home page Giter VIP logo

#include<stdio.h> #include<string.h> int main() { char str[100];

gets_s(str);
int last = strlen(str);
int frontindex = 0, backindex = last - 1;
for (int i = 0; i < last; i++)
{
	int panduan1 = str[i] >= 'a' && str[i] <= 'z';
	int panduan2 = str[i] >= 'A' && str[i] <= 'Z';
	if ((panduan1 || panduan2 == 1) || str[i] == '*')
	{
		;
	}
	else
	{
		printf("error\n");
		return -1;
	}

}
while (1)
{
	int panduan1 = str[frontindex] >= 'a' && str[frontindex] <= 'z';
	int panduan2 = str[frontindex] >= 'A' && str[frontindex] <= 'Z';
	if (panduan1 || panduan2 == 1)
	{
		break;
	}
	else
	{
		frontindex++;
	}
}
while (1)
{
	int panduan1 = str[backindex] >= 'a' && str[backindex] <= 'z';
	int panduan2 = str[backindex] >= 'A' && str[backindex] <= 'Z';
	if (panduan1 || panduan2 == 1)
	{
		break;
	}
	else
	{
		backindex--;
	}
	if (backindex == 0)
	{
		backindex = last - 1;
		break;
	}
}
for (int i = 0; i < frontindex; i++)
{
	if (str[i] == '*')

		printf("%c",str[i]);

}
for (int i = frontindex; i <= backindex; i++)
{
	int panduan1 = str[i] >= 'a' && str[i] <= 'z';
	int panduan2 = str[i] >= 'A' && str[i] <= 'Z';
	if (str[i] == '*')
	{
		;

	}
	else if (panduan1 || panduan2 == 1)
	{
		printf("%c", str[i]);
	}


}
for (int i = backindex+1; i < last; i++)
{
	if (str[i] == '*')
	{
		printf("%c", str[i]);

	}

}
printf("\n");
return 0;

}

qangit's Projects

- icon -

电子科技大学 2020 级《数据挖掘与大数据分析》课程代码。

qangit icon qangit

Config files for my GitHub profile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.