Skip to content

Commit 33d573a

Browse files
committed
added palindrome problem
1 parent 171d9ea commit 33d573a

30 files changed

+280
-0
lines changed

Chapter1/Problem1.6/Add

Whitespace-only changes.

Chapter1/Problem1.6/Open

Whitespace-only changes.

Chapter1/Problem1.6/Problem1.6.exe

75.9 KB
Binary file not shown.

Chapter1/Problem1.6/Project

Whitespace-only changes.

Chapter1/Problem1.6/Start

Whitespace-only changes.

Chapter2/Problem2.28/Problem2.28.exe

77.3 KB
Binary file not shown.
19 KB
Binary file not shown.
Binary file not shown.
52 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<ProjectOutputs>
4+
<ProjectOutput>
5+
<FullPath>C:\Users\jaros\Desktop\Me-Learning-CPP\Chapter2\Problem2.29\Debug\Problem2.29.exe</FullPath>
6+
</ProjectOutput>
7+
</ProjectOutputs>
8+
<ContentFiles />
9+
<SatelliteDlls />
10+
<NonRecipeFileRefs />
11+
</Project>
571 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
 Problem2.29.cpp
2+
Problem2.29.vcxproj -> C:\Users\jaros\Desktop\Me-Learning-CPP\Chapter2\Problem2.29\Debug\Problem2.29.exe
64.1 KB
Binary file not shown.
660 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.28.29333:TargetPlatformVersion=10.0.18362.0:
2+
Debug|Win32|C:\Users\jaros\Desktop\Me-Learning-CPP\Chapter2\Problem2.29\|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
C:\Users\jaros\Desktop\Me-Learning-CPP\Chapter2\Problem2.29\Debug\Problem2.29.exe
2+
C:\Users\jaros\Desktop\Me-Learning-CPP\Chapter2\Problem2.29\Debug\Problem2.29.pdb

Chapter2/Problem2.29/Debug/vc142.idb

163 KB
Binary file not shown.

Chapter2/Problem2.29/Debug/vc142.pdb

460 KB
Binary file not shown.

Chapter2/Problem2.29/Problem2.29.cpp

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Problem2.29.cpp : This file contains the 'main' function. Program execution begins and ends there.
2+
//
3+
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
4+
// Debug program: F5 or Debug > Start Debugging menu
5+
//
6+
// Tips for Getting Started:
7+
// 1. Use the Solution Explorer window to add/manage files
8+
// 2. Use the Team Explorer window to connect to source control
9+
// 3. Use the Output window to see build output and other messages
10+
// 4. Use the Error List window to view errors
11+
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
12+
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
13+
//
14+
// Written by James Rosado 3-10-2021
15+
#include <iostream>
16+
using std::cout;
17+
using std::cin;
18+
using std::endl;
19+
20+
#include <iomanip>
21+
using std::fixed;
22+
using std::setprecision;
23+
24+
int main()
25+
{
26+
int number, tempnumber;
27+
int originalnumber,flippednumber;
28+
29+
flippednumber = 0;
30+
31+
cout << "Enter in a five-digit number: ";
32+
cin >> originalnumber;
33+
number = originalnumber;
34+
35+
for (int i = 0; i <= 4; i++)
36+
{
37+
cout << number % 10 << endl;
38+
tempnumber = number % 10;
39+
40+
for (int j = 4; j >i; j--)
41+
{
42+
tempnumber = tempnumber * 10;
43+
}
44+
45+
number = number / 10;
46+
flippednumber = flippednumber + tempnumber;
47+
}
48+
49+
if (flippednumber == originalnumber)
50+
{
51+
cout << "The number " << originalnumber << " is a palindrome." << endl;
52+
}
53+
else
54+
{
55+
cout << "The number " << originalnumber << " is not a palindrome." << endl;
56+
}
57+
58+
return 0;
59+
}

Chapter2/Problem2.29/Problem2.29.sln

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31019.35
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Problem2.29", "Problem2.29.vcxproj", "{0C7A3231-35D1-440C-9896-3C146D1CF74D}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{0C7A3231-35D1-440C-9896-3C146D1CF74D}.Debug|x64.ActiveCfg = Debug|x64
17+
{0C7A3231-35D1-440C-9896-3C146D1CF74D}.Debug|x64.Build.0 = Debug|x64
18+
{0C7A3231-35D1-440C-9896-3C146D1CF74D}.Debug|x86.ActiveCfg = Debug|Win32
19+
{0C7A3231-35D1-440C-9896-3C146D1CF74D}.Debug|x86.Build.0 = Debug|Win32
20+
{0C7A3231-35D1-440C-9896-3C146D1CF74D}.Release|x64.ActiveCfg = Release|x64
21+
{0C7A3231-35D1-440C-9896-3C146D1CF74D}.Release|x64.Build.0 = Release|x64
22+
{0C7A3231-35D1-440C-9896-3C146D1CF74D}.Release|x86.ActiveCfg = Release|Win32
23+
{0C7A3231-35D1-440C-9896-3C146D1CF74D}.Release|x86.Build.0 = Release|Win32
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {E1B88D83-BDC3-4463-BD21-C7272E0CCD58}
30+
EndGlobalSection
31+
EndGlobal
+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>16.0</VCProjectVersion>
23+
<Keyword>Win32Proj</Keyword>
24+
<ProjectGuid>{0c7a3231-35d1-440c-9896-3c146d1cf74d}</ProjectGuid>
25+
<RootNamespace>Problem229</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v142</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v142</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v142</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v142</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<LinkIncremental>true</LinkIncremental>
75+
</PropertyGroup>
76+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
77+
<LinkIncremental>false</LinkIncremental>
78+
</PropertyGroup>
79+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
80+
<LinkIncremental>true</LinkIncremental>
81+
</PropertyGroup>
82+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
83+
<LinkIncremental>false</LinkIncremental>
84+
</PropertyGroup>
85+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
86+
<ClCompile>
87+
<WarningLevel>Level3</WarningLevel>
88+
<SDLCheck>true</SDLCheck>
89+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
90+
<ConformanceMode>true</ConformanceMode>
91+
</ClCompile>
92+
<Link>
93+
<SubSystem>Console</SubSystem>
94+
<GenerateDebugInformation>true</GenerateDebugInformation>
95+
</Link>
96+
</ItemDefinitionGroup>
97+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
98+
<ClCompile>
99+
<WarningLevel>Level3</WarningLevel>
100+
<FunctionLevelLinking>true</FunctionLevelLinking>
101+
<IntrinsicFunctions>true</IntrinsicFunctions>
102+
<SDLCheck>true</SDLCheck>
103+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
104+
<ConformanceMode>true</ConformanceMode>
105+
</ClCompile>
106+
<Link>
107+
<SubSystem>Console</SubSystem>
108+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
109+
<OptimizeReferences>true</OptimizeReferences>
110+
<GenerateDebugInformation>true</GenerateDebugInformation>
111+
</Link>
112+
</ItemDefinitionGroup>
113+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
114+
<ClCompile>
115+
<WarningLevel>Level3</WarningLevel>
116+
<SDLCheck>true</SDLCheck>
117+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118+
<ConformanceMode>true</ConformanceMode>
119+
</ClCompile>
120+
<Link>
121+
<SubSystem>Console</SubSystem>
122+
<GenerateDebugInformation>true</GenerateDebugInformation>
123+
</Link>
124+
</ItemDefinitionGroup>
125+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
126+
<ClCompile>
127+
<WarningLevel>Level3</WarningLevel>
128+
<FunctionLevelLinking>true</FunctionLevelLinking>
129+
<IntrinsicFunctions>true</IntrinsicFunctions>
130+
<SDLCheck>true</SDLCheck>
131+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
132+
<ConformanceMode>true</ConformanceMode>
133+
</ClCompile>
134+
<Link>
135+
<SubSystem>Console</SubSystem>
136+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
137+
<OptimizeReferences>true</OptimizeReferences>
138+
<GenerateDebugInformation>true</GenerateDebugInformation>
139+
</Link>
140+
</ItemDefinitionGroup>
141+
<ItemGroup>
142+
<ClCompile Include="Problem2.29.cpp" />
143+
</ItemGroup>
144+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
145+
<ImportGroup Label="ExtensionTargets">
146+
</ImportGroup>
147+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="Problem2.29.cpp">
19+
<Filter>Source Files</Filter>
20+
</ClCompile>
21+
</ItemGroup>
22+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
</Project>

0 commit comments

Comments
 (0)