提交 d408345a 编写于 作者: Gongzi-Yu's avatar Gongzi-Yu

调整了一下顺序,有些文件命名错误

上级 1fd0e1d8
#include <stdio.h>
#include <string.h>
void swap(char *s1,char *s2)
{
char s3[20];
strcpy(s3, s2);
strcpy(s2, s1);
strcpy(s1, s3);
}
int main()
{
char str1[20],str2[20],str3[20];
scanf("%s",str1);
scanf("%s",str2);
scanf("%s",str3);
if(strcmp(str1,str2)>0)
swap(str1,str2);
if(strcmp(str1,str3)>0)
swap(str1,str3);
if(strcmp(str2,str3)>0)
swap(str2,str3);
printf("%s\t%s\t%s",str1,str2,str3);
return 0;
#include <stdio.h>
#include <string.h>
void swap(char *s1,char *s2)
{
char s3[20];
strcpy(s3, s2);
strcpy(s2, s1);
strcpy(s1, s3);
}
int main()
{
char str1[20],str2[20],str3[20];
scanf("%s",str1);
scanf("%s",str2);
scanf("%s",str3);
if(strcmp(str1,str2)>0)
swap(str1,str2);
if(strcmp(str1,str3)>0)
swap(str1,str3);
if(strcmp(str2,str3)>0)
swap(str2,str3);
printf("%s\t%s\t%s",str1,str2,str3);
return 0;
}
\ No newline at end of file
#include <stdio.h>
void getDigits(char *s1, char *s2)
{
int i,j;
char *p = s1,*s = s2;
while(*p != 0)
{
if(*p >= 48&&*p<=57)
*s++ = *p++;
else *p++;
}
*s = 0;
}
int main()
{
char s1[20],s2[20];
scanf("%s",s1);
getDigits(s1,s2);
printf("%s",s2);
return 0;
}
#include <stdio.h>
void getDigits(char *s1, char *s2)
{
int i,j;
char *p = s1,*s = s2;
while(*p != 0)
{
if(*p >= 48&&*p<=57)
*s++ = *p++;
else *p++;
}
*s = 0;
}
int main()
{
char s1[20],s2[20];
scanf("%s",s1);
getDigits(s1,s2);
printf("%s",s2);
return 0;
}
#include <stdio.h>
int isLetter(char c)
{
if((c>=65&&c<=90)||(c>=97&&c<=122))
return 1;
else return 0;
}
char toUpper(char c)
{
if(c >= 65&&c<=90)
return c;
else
{
int s = c - 32;
return s;
}
}
void firstUpper(char *s)
{
char *p = s;
int count = 0;
while(*p!=0)
{
if(isLetter(*p)&&(count == 0))
{
*p = toUpper(*p);
*p++;
count = 1;
}
if(!isLetter(*p++))
count = 0;
}
}
int main()
{
char s[] = "there are five apples in the basket";
firstUpper(s);
printf("%s",s);
}
#include <stdio.h>
int isLetter(char c)
{
if((c>=65&&c<=90)||(c>=97&&c<=122))
return 1;
else return 0;
}
char toUpper(char c)
{
if(c >= 65&&c<=90)
return c;
else
{
int s = c - 32;
return s;
}
}
void firstUpper(char *s)
{
char *p = s;
int count = 0;
while(*p!=0)
{
if(isLetter(*p)&&(count == 0))
{
*p = toUpper(*p);
*p++;
count = 1;
}
if(!isLetter(*p++))
count = 0;
}
}
int main()
{
char s[] = "there are five apples in the basket";
firstUpper(s);
printf("%s",s);
}
#include <stdio.h>
#include <string.h>
void filter(char *a)
{
char p[100];
int i, j = 0;
for (i = 0; i < 100; i++)
{
if (a[i] >= 65 && a[i] <= 90)
p[j++] = a[i];
if (a[i] >= 97 && a[i] <= 122)
p[j++] = a[i] - 32;
}
p[j] = 0;
for (i = 0; i < 100; i++)
a[i] = p[i];
}
int palin(char *a)
{
char b[100];
filter(b);
char* head = b, * tail = b;
int count = 1;
for (int i = 0; b[i] != 0; i++)
tail++;
while (head < tail)
{
if (*head++ != *tail++) {
break;
count = 0;
}
}
return count;
}
int main()
{
char a[100];
scanf("%s", a);
if (palin(a)) printf("yes");
else printf("no");
return 0;
#include <stdio.h>
#include <string.h>
void filter(char *a)
{
char p[100];
int i, j = 0;
for (i = 0; i < 100; i++)
{
if (a[i] >= 65 && a[i] <= 90)
p[j++] = a[i];
if (a[i] >= 97 && a[i] <= 122)
p[j++] = a[i] - 32;
}
p[j] = 0;
for (i = 0; i < 100; i++)
a[i] = p[i];
}
int palin(char *a)
{
char b[100];
filter(b);
char* head = b, * tail = b;
int count = 1;
for (int i = 0; b[i] != 0; i++)
tail++;
while (head < tail)
{
if (*head++ != *tail++) {
break;
count = 0;
}
}
return count;
}
int main()
{
char a[100];
scanf("%s", a);
if (palin(a)) printf("yes");
else printf("no");
return 0;
}
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "C语言课程设计", "C语言课程设计.vcxproj", "{2E2CB14A-5141-4136-9B14-56A832C31276}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2E2CB14A-5141-4136-9B14-56A832C31276}.Debug|x64.ActiveCfg = Debug|x64
{2E2CB14A-5141-4136-9B14-56A832C31276}.Debug|x64.Build.0 = Debug|x64
{2E2CB14A-5141-4136-9B14-56A832C31276}.Debug|x86.ActiveCfg = Debug|Win32
{2E2CB14A-5141-4136-9B14-56A832C31276}.Debug|x86.Build.0 = Debug|Win32
{2E2CB14A-5141-4136-9B14-56A832C31276}.Release|x64.ActiveCfg = Release|x64
{2E2CB14A-5141-4136-9B14-56A832C31276}.Release|x64.Build.0 = Release|x64
{2E2CB14A-5141-4136-9B14-56A832C31276}.Release|x86.ActiveCfg = Release|Win32
{2E2CB14A-5141-4136-9B14-56A832C31276}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {90C7E1DF-258F-4868-A856-85E6E7A404BA}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{2e2cb14a-5141-4136-9b14-56a832c31276}</ProjectGuid>
<RootNamespace>C语言课程设计</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="ks_main.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ks_main.c">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册