Skip to content

Commit 8870c8e

Browse files
committed
Upload day1
0 parents  commit 8870c8e

File tree

12 files changed

+270
-0
lines changed

12 files changed

+270
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.codelite/
2+
Competitive.workspace
3+
Makefile

Day1-HelloWorld/Day1-HelloWorld.mk

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
##
2+
## Auto Generated makefile by CodeLite IDE
3+
## any manual changes will be erased
4+
##
5+
## Debug
6+
ProjectName :=Day1-HelloWorld
7+
ConfigurationName :=Debug
8+
WorkspacePath :=/home/geekayush/Competitive
9+
ProjectPath :=/home/geekayush/Competitive/Day1-HelloWorld
10+
IntermediateDirectory :=./Debug
11+
OutDir := $(IntermediateDirectory)
12+
CurrentFileName :=
13+
CurrentFilePath :=
14+
CurrentFileFullPath :=
15+
User :=Ayush
16+
Date :=08/06/19
17+
CodeLitePath :=/home/geekayush/.codelite
18+
LinkerName :=/usr/bin/g++
19+
SharedObjectLinkerName :=/usr/bin/g++ -shared -fPIC
20+
ObjectSuffix :=.o
21+
DependSuffix :=.o.d
22+
PreprocessSuffix :=.i
23+
DebugSwitch :=-g
24+
IncludeSwitch :=-I
25+
LibrarySwitch :=-l
26+
OutputSwitch :=-o
27+
LibraryPathSwitch :=-L
28+
PreprocessorSwitch :=-D
29+
SourceSwitch :=-c
30+
OutputFile :=$(IntermediateDirectory)/$(ProjectName)
31+
Preprocessors :=
32+
ObjectSwitch :=-o
33+
ArchiveOutputSwitch :=
34+
PreprocessOnlySwitch :=-E
35+
ObjectsFileList :="Day1-HelloWorld.txt"
36+
PCHCompileFlags :=
37+
MakeDirCommand :=mkdir -p
38+
LinkOptions :=
39+
IncludePath := $(IncludeSwitch). $(IncludeSwitch).
40+
IncludePCH :=
41+
RcIncludePath :=
42+
Libs :=
43+
ArLibs :=
44+
LibPath := $(LibraryPathSwitch).
45+
46+
##
47+
## Common variables
48+
## AR, CXX, CC, AS, CXXFLAGS and CFLAGS can be overriden using an environment variables
49+
##
50+
AR := /usr/bin/ar rcu
51+
CXX := /usr/bin/g++
52+
CC := /usr/bin/gcc
53+
CXXFLAGS := -g -O0 -Wall $(Preprocessors)
54+
CFLAGS := -g -O0 -Wall $(Preprocessors)
55+
ASFLAGS :=
56+
AS := /usr/bin/as
57+
58+
59+
##
60+
## User defined environment variables
61+
##
62+
CodeLiteDir:=/usr/share/codelite
63+
Objects0=$(IntermediateDirectory)/main.c$(ObjectSuffix)
64+
65+
66+
67+
Objects=$(Objects0)
68+
69+
##
70+
## Main Build Targets
71+
##
72+
.PHONY: all clean PreBuild PrePreBuild PostBuild MakeIntermediateDirs
73+
all: $(OutputFile)
74+
75+
$(OutputFile): $(IntermediateDirectory)/.d $(Objects)
76+
@$(MakeDirCommand) $(@D)
77+
@echo "" > $(IntermediateDirectory)/.d
78+
@echo $(Objects0) > $(ObjectsFileList)
79+
$(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)
80+
81+
MakeIntermediateDirs:
82+
@test -d ./Debug || $(MakeDirCommand) ./Debug
83+
84+
85+
$(IntermediateDirectory)/.d:
86+
@test -d ./Debug || $(MakeDirCommand) ./Debug
87+
88+
PreBuild:
89+
90+
91+
##
92+
## Objects
93+
##
94+
$(IntermediateDirectory)/main.c$(ObjectSuffix): main.c $(IntermediateDirectory)/main.c$(DependSuffix)
95+
$(CC) $(SourceSwitch) "/home/geekayush/Competitive/Day1-HelloWorld/main.c" $(CFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main.c$(ObjectSuffix) $(IncludePath)
96+
$(IntermediateDirectory)/main.c$(DependSuffix): main.c
97+
@$(CC) $(CFLAGS) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main.c$(ObjectSuffix) -MF$(IntermediateDirectory)/main.c$(DependSuffix) -MM main.c
98+
99+
$(IntermediateDirectory)/main.c$(PreprocessSuffix): main.c
100+
$(CC) $(CFLAGS) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main.c$(PreprocessSuffix) main.c
101+
102+
103+
-include $(IntermediateDirectory)/*$(DependSuffix)
104+
##
105+
## Clean
106+
##
107+
clean:
108+
$(RM) -r ./Debug/
109+
110+
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CodeLite_Project Name="Day1-HelloWorld" Version="10.0.0" InternalType="Console">
3+
<Description/>
4+
<Dependencies/>
5+
<Settings Type="Executable">
6+
<GlobalSettings>
7+
<Compiler Options="" C_Options="" Assembler="">
8+
<IncludePath Value="."/>
9+
</Compiler>
10+
<Linker Options="">
11+
<LibraryPath Value="."/>
12+
</Linker>
13+
<ResourceCompiler Options=""/>
14+
</GlobalSettings>
15+
<Configuration Name="Debug" CompilerType="GCC" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
16+
<Compiler Options="-g;-O0;-Wall" C_Options="-g;-O0;-Wall" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0">
17+
<IncludePath Value="."/>
18+
</Compiler>
19+
<Linker Options="" Required="yes"/>
20+
<ResourceCompiler Options="" Required="no"/>
21+
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/>
22+
<BuildSystem Name="Default"/>
23+
<Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
24+
<![CDATA[]]>
25+
</Environment>
26+
<Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="" IsExtended="no">
27+
<DebuggerSearchPaths/>
28+
<PostConnectCommands/>
29+
<StartupCommands/>
30+
</Debugger>
31+
<PreBuild/>
32+
<PostBuild/>
33+
<CustomBuild Enabled="no">
34+
<RebuildCommand/>
35+
<CleanCommand/>
36+
<BuildCommand/>
37+
<PreprocessFileCommand/>
38+
<SingleFileCommand/>
39+
<MakefileGenerationCommand/>
40+
<ThirdPartyToolName>None</ThirdPartyToolName>
41+
<WorkingDirectory/>
42+
</CustomBuild>
43+
<AdditionalRules>
44+
<CustomPostBuild/>
45+
<CustomPreBuild/>
46+
</AdditionalRules>
47+
<Completion EnableCpp11="no" EnableCpp14="no">
48+
<ClangCmpFlagsC/>
49+
<ClangCmpFlags/>
50+
<ClangPP/>
51+
<SearchPaths/>
52+
</Completion>
53+
</Configuration>
54+
<Configuration Name="Release" CompilerType="GCC" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
55+
<Compiler Options="-O2;-Wall" C_Options="-O2;-Wall" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0">
56+
<IncludePath Value="."/>
57+
<Preprocessor Value="NDEBUG"/>
58+
</Compiler>
59+
<Linker Options="" Required="yes"/>
60+
<ResourceCompiler Options="" Required="no"/>
61+
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/>
62+
<BuildSystem Name="Default"/>
63+
<Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
64+
<![CDATA[]]>
65+
</Environment>
66+
<Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="" IsExtended="no">
67+
<DebuggerSearchPaths/>
68+
<PostConnectCommands/>
69+
<StartupCommands/>
70+
</Debugger>
71+
<PreBuild/>
72+
<PostBuild/>
73+
<CustomBuild Enabled="no">
74+
<RebuildCommand/>
75+
<CleanCommand/>
76+
<BuildCommand/>
77+
<PreprocessFileCommand/>
78+
<SingleFileCommand/>
79+
<MakefileGenerationCommand/>
80+
<ThirdPartyToolName>None</ThirdPartyToolName>
81+
<WorkingDirectory/>
82+
</CustomBuild>
83+
<AdditionalRules>
84+
<CustomPostBuild/>
85+
<CustomPreBuild/>
86+
</AdditionalRules>
87+
<Completion EnableCpp11="no" EnableCpp14="no">
88+
<ClangCmpFlagsC/>
89+
<ClangCmpFlags/>
90+
<ClangPP/>
91+
<SearchPaths/>
92+
</Completion>
93+
</Configuration>
94+
</Settings>
95+
<VirtualDirectory Name="src">
96+
<File Name="main.c"/>
97+
</VirtualDirectory>
98+
</CodeLite_Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./Debug/main.c.o

Day1-HelloWorld/Debug/.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10.6 KB
Binary file not shown.

Day1-HelloWorld/Debug/main.c.o

5.88 KB
Binary file not shown.

Day1-HelloWorld/Debug/main.c.o.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Debug/main.c.o: main.c

Day1-HelloWorld/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Objective
2+
In this challenge, we review some basic concepts that will get you started with this series. You will need to use the same (or similar) syntax to read input and write output in challenges throughout HackerRank. Check out the Tutorial tab for learning materials and an instructional video!
3+
4+
## Task
5+
To complete this challenge, you must save a line of input from stdin to a variable, print Hello, World. on a single line, and finally print the value of your variable on a second line.
6+
7+
You've got this!
8+
9+
Note: The instructions are Java-based, but we support submissions in many popular languages. You can switch languages using the drop-down menu above your editor, and the variable may be written differently depending on the best-practice conventions of your submission language.
10+
11+
## Input Format
12+
13+
A single line of text denoting (the variable whose contents must be printed).
14+
15+
## Output Format
16+
17+
Print Hello, World. on the first line, and the contents of on the second line.
18+
19+
## Sample Input
20+
```
21+
Welcome to 30 Days of Code!
22+
```
23+
24+
## Sample Output
25+
```
26+
Hello, World.
27+
Welcome to 30 Days of Code!
28+
```
29+
30+
## Explanation
31+
32+
On the first line, we print the string literal Hello, World.. On the second line, we print the contents of the variable which, for this sample case, happens to be Welcome to 30 Days of Code!. If you do not print the variable's contents to stdout, you will not pass the hidden test case.

Day1-HelloWorld/main.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <cmath>
2+
#include <cstdio>
3+
#include <vector>
4+
#include <iostream>
5+
#include <algorithm>
6+
using namespace std;
7+
int main() {
8+
string input_string;
9+
getline(cin, input_string);
10+
cout << "Hello, World." << endl;
11+
cout << input_string;
12+
return 0;
13+
}

0 commit comments

Comments
 (0)