Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ctype.h>
- #include <stddef.h>
- #include <fstream>
- #include <iostream>
- #include <string>
- const char* nimRattoren[] = {
- "black", "red", "green", "brown",
- "blue", "purple", "cyan", "silver",
- "gray", "pink", "lime", "yellow",
- "lightBlue", "magenta", "orange", "white"
- };
- void sins(const char* donx, size_t a, const char* nim) {
- const char* d = donx;
- while (*d != '\0') {
- if (*d == '%') {
- ++d;
- if (*d == '%')
- std::cout << '%';
- else if (*d == 'r')
- std::cout << nimRattoren[a];
- else if (*d == 'R') {
- std::cout << toupper(nimRattoren[a][0]);
- std::cout << (nimRattoren[a] + 1);
- } else if (*d == 'e')
- std::cout << nim;
- } else std::cout << *d;
- ++d;
- }
- std::cout << '\n';
- }
- int main(int aMixpalet, char** mixpalet) {
- if (aMixpalet <= 1) {
- std::cerr << "est e hosi et xir!\n";
- return -1;
- }
- std::string donx, nim;
- std::getline(std::cin, donx);
- std::ifstream hosi(mixpalet[1]);
- for (size_t i = 0; i < 16; ++i) {
- std::getline(hosi, nim);
- sins(donx.c_str(), i, nim.c_str());
- }
- }
Add Comment
Please, Sign In to add comment