Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 57dd20f

Browse files
author
Abdullah
committed
init
1 parent c2f4e94 commit 57dd20f

22 files changed

+132
-74
lines changed

‎2_0_decode_message.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#include <iostream>
22

3+
/*
4+
Decode a message from integers to text, without using arrays or strings.
5+
*/
6+
7+
38
using std::cin;
49
using std::cout;
510

‎2_0_half_square.cpp‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

‎2_0_luhne_checksum.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
using std::cin;
44
using std::cout;
55

6+
/*
7+
Luhn checksum without saving the numbers, processing each number one by one.
8+
*/
9+
10+
11+
12+
613
int main()
714
{
815

‎2_0_sideways_triangle.cpp‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include <iostream>
2+
3+
/*
4+
Write a program that uses only two output statements,
5+
cout << "#" and cout << "\ n", to produce a pattern of
6+
hash symbols shaped like a sideways triangle:
7+
8+
#
9+
##
10+
###
11+
####
12+
###
13+
##
14+
#
15+
16+
17+
*/
18+
19+
using std::cout;
20+
21+
22+
int main()
23+
{
24+
int nrOfRows = 7;
25+
int width = nrOfRows / 2;
26+
27+
for (int row = 0; row < nrOfRows; row++)
28+
{
29+
cout << "\n";
30+
for (int hashNum = 1; hashNum <= (width+1) - abs(row - width); hashNum++)
31+
{
32+
cout << "#";
33+
}
34+
}
35+
36+
}
37+
38+

‎2_1_hash_shape.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include <iostream>
33
#include <iomanip>
44

5+
/*
6+
Hash shape by using only single cout functions.
7+
*/
8+
59
using std::cin;
610
using std::cout;
711
using std::endl;

‎2_2_hash_shape.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include <iostream>
33
#include <iomanip>
44

5+
/*
6+
Hash shape by using only single cout functions.
7+
*/
8+
59
using std::cin;
610
using std::cout;
711
using std::endl;

‎2_3_hash_shape.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include <iostream>
33
#include <iomanip>
44

5+
/*
6+
Hash shape by using only single cout functions.
7+
*/
8+
59
using std::cin;
610
using std::cout;
711
using std::endl;

‎2_4_hash_shape.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include <iostream>
33
#include <iomanip>
44

5+
/*
6+
Hash shape by using only single cout functions.
7+
*/
8+
59
using std::cin;
610
using std::cout;
711
using std::endl;

‎2_5_ISBN_validator.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
using std::cin;
44
using std::cout;
55

6+
/*
7+
ISBN validator without using arrays.
8+
*/
9+
10+
611
enum isbnPart {PREFIX, GROUP, REGISTRANT, PUBLICATION, CHECK, COMPLETED};
712

813
bool verifyPart(int nr, int digitCount, int part);

‎2_6_binary_decimal_converter.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ using std::cout;
66
using std::endl;
77
using std::pow;
88

9-
9+
/*
10+
Binary and decimal converter without using arrays (or strings)
11+
*/
1012

1113
int main()
1214
{

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /