-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create Tansin.txt * createdPrintZ.cpp First code * createdPrintZ My first code * createGradingSystem.cpp grading system code * MoreOfGettingStarted 5 more solutions of getting started * Patterns Patterns module
- Loading branch information
Showing
5 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern1.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(int argc, char **argv){ | ||
int n; | ||
cin >> n; | ||
|
||
for(int i=1;i<=n;i++){ | ||
for(int j=1;j<=i;j++){ | ||
cout<<"*\t"; | ||
}cout<<endl; | ||
} | ||
return 0; | ||
} |
15 changes: 15 additions & 0 deletions
15
IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(int argc, char **argv){ | ||
int n; | ||
cin >> n; | ||
for(int i=n;i>=1;i--){ | ||
for(int j=1;j<=i;j++){ | ||
cout<<"*\t"; | ||
}cout<<endl; | ||
} | ||
return 0; | ||
|
||
|
||
} |
20 changes: 20 additions & 0 deletions
20
IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern3.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(int argc, char **argv){ | ||
int n; | ||
cin >> n; | ||
for(int i=1;i<=n;i++) | ||
{ | ||
for(int j=1;j<=n;j++) | ||
{ | ||
if(j>=n+1-i) | ||
cout<<"* "; | ||
else | ||
cout<<" "; | ||
} | ||
cout<<endl; | ||
} | ||
return 0; | ||
} | ||
|
23 changes: 23 additions & 0 deletions
23
IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern4.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(int argc, char **argv){ | ||
int n; | ||
cin >> n; | ||
|
||
for(int i=n;i>=1;i--) | ||
{ | ||
for(int j=1;j<=n;j++) | ||
{ | ||
if(j>=n+1-i) | ||
cout<<"* "; | ||
else | ||
cout<<" "; | ||
} | ||
cout<<endl; | ||
} | ||
return 0; | ||
} | ||
|
||
|
||
|
26 changes: 26 additions & 0 deletions
26
IOT/tansin25_TanmaySingh_2125csit1072_2/Patterns/Pattern5.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(int argc, char **argv){ | ||
int n; | ||
cin >> n; | ||
int s=n/2,a=1; | ||
for(int i=1;i<=n;i++){ | ||
for(int j=1;j<=s;j++){ | ||
cout<<("\t"); | ||
} | ||
for(int j=1;j<=a;j++){ | ||
cout<<("*\t"); | ||
} | ||
cout<<endl; | ||
if(i<=n/2){ | ||
s--; | ||
a=a+2; | ||
} | ||
else{ | ||
s++; | ||
a=a-2; | ||
} | ||
} | ||
return 0; | ||
} |