-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17d9607
commit d6bc6d6
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
2. Programming/1. Data types/Three Latin letters/program.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,30 @@ | ||
#include <iostream> | ||
#include <vector> | ||
#include <string> | ||
using namespace std; | ||
int main() | ||
{ | ||
int n; | ||
std::cin >> n; | ||
std::vector<char> letters; | ||
for (int i = 97; i < 97 + n; ++i) | ||
{ | ||
letters.push_back(char(i)); | ||
} | ||
|
||
for (auto a : letters) | ||
{ | ||
for (auto b : letters) | ||
{ | ||
for (auto c : letters) | ||
{ | ||
if (a <= b || b <= c || c <= a) | ||
{ | ||
std::cout << a << b << c << std::endl; | ||
} | ||
} | ||
} | ||
} | ||
|
||
return 0; | ||
} |