Last active
December 11, 2017 01:39
-
-
Save bluebear94/0726d820c613ed5abf3c4aa0be8de132 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#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()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment