2024.2.8

 

2024.2.8_第1张图片

 2024.2.8_第2张图片

#include
#include
int main(int argc, const char *argv[])
{
	char str[300];
	puts("please input str:");
	gets(str);
	char *p=str;
	int number=0;
	while(*p!='\0')
	{
		if(*p==' ')
		{
			number++;
		}
		p++;
	}
	if(str[0]=='\0')
	{
		printf("str have %d number words:\n",number);
	}
	else
	{
	printf("str have %d number words:\n",number+1);
	}
	return 0;
}

2024.2.8_第3张图片 

 

#!/bin/bash
read file
if [   -b $file ]
then
	echo "块设备"
elif [ -c $file ]
then 
	echo "字符"
elif [ -d $file ]
then
	echo "目录"
elif [ -f $file ]
then 
	echo "普通"
elif [ -L $file ]
then
	echo "软连接"
elif [ -p $file ]
then 
	echo "管道"
elif [ -S $file ]
then
	echo "套接字"
fi

2024.2.8_第4张图片

2024.2.8_第5张图片

#include
#include
void nizhi(char *str1)
{
	int j=strlen(str1)-1;
	int i=0;
	while(i

2024.2.8_第6张图片

你可能感兴趣的:(java,linux,算法)