Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <fstream>
- void Kappa(int n, char inName[], char outName[]){
- std::fstream in;
- in.open(inName, std::fstream::in);
- std::fstream out;
- out.open(outName, std::fstream::out);
- in.seekg(0, in.end);
- int len = in.tellg();
- char c;
- while (n-- && len--)
- {
- in.seekg(len, in.beg);
- c = in.get();
- if(std::isdigit(c)){
- c = '0' + ('9' - c);
- }
- out << c;
- }
- in.close();
- out.close();
- }
- int main(int argc, char* argv[]){
- int x;
- x = strtol(argv[1], NULL, 10);
- Kappa(x, argv[2], argv[3]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement