Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1
- 0
- First:Second
- Testing string!
- ---------------
- /**************
- * Author : karroje
- * Date : 2011-02-01
- * Purpose : Code provided for student to ensure that their
- * : Phase 01 code will correctly compile.
- * NOTE : This file does NOT comprehensivally test your code -- its only
- * : purpose to ensure that your code *compiles*. So long as you can
- * : compile your code with this file as main.cpp, the grader will
- * : be able to check for correctness. But it does not mean that your
- * : code is correct.
- **************/
- #include "rsa_functions.h"
- #include "encrypt.h"
- #include <iostream>
- using namespace std;
- int main() {
- char s1[] = "First";
- char s2[] = "Second";
- cout << isLetter('a') << endl;
- cout << isUpper('b') << endl;
- char* d = concatStrings(s1, s2, ':');
- cout << d << endl;
- char* t = "Testing string";
- char* s = (char*)malloc( (strlen(t) + 1)*sizeof(char));
- strncpy(s, t + '\0', strlen(t) +1);
- addChar(&s, '!');
- cout << s << endl;
- int size;
- char* s3 = readFile("main.cpp", &size);
- cout << "---------------\n" << s3 << "\n---------------\n";
- char* e = ceasarCipher(s3, size, 10);
- cout << "---------------\n" << e << "\n---------------\n";
- char* c = ceasarDecipher(e, size, 10);
- cout << "---------------\n" << c << "\n---------------\n";
- return 0;
- }
- ---------------
- ---------------
- /**************
- * Kferyc : ukccyto
- * Nkeo : 2011-02-01
- * Zfczydo : Myno zcygsnon pyc defnoxe ey oxdfco erke erosc
- * : Zrkdo 01 myno hsvv myccomevj mywzsvo.
- * XYEO : Ersd psvo nyod XYE mywzcoroxdsgkvvj eode jyfc myno -- sed yxvj
- * : zfczydo ey oxdfco erke jyfc myno *mywzsvod*. Dy vyxq kd jyf mkx
- * : mywzsvo jyfc myno hser ersd psvo kd wksx.mzz, ero qcknoc hsvv
- * : lo klvo ey mromu pyc myccomexodd. Lfe se nyod xye wokx erke jyfc
- * : myno sd myccome.
- **************/
- #sxmvfno "cdk_pfxmesyxd.r"
- #sxmvfno "oxmcjze.r"
- #sxmvfno <sydecokw>
- fdsxq xkwodzkmo den;
- sxe wksx() {
- mrkc d1[] = "Pscde";
- mrkc d2[] = "Domyxn";
- myfe << sdVoeeoc('k') << oxnv;
- myfe << sdFzzoc('l') << oxnv;
- mrkc* n = myxmkeDecsxqd(d1, d2, ':');
- myfe << n << oxnv;
- mrkc* e = "Eodesxq decsxq";
- mrkc* d = (mrkc*)wkvvym( (decvox(e) + 1)*dskoyp(mrkc));
- decxmzj(d, e + '\0', decvox(e) +1);
- knnMrkc(&d, '!');
- myfe << d << oxnv;
- sxe dsko;
- mrkc* d3 = coknPsvo("wksx.mzz", &dsko);
- myfe << "---------------\x" << d3 << "\x---------------\x";
- mrkc* o = mokdkcMszroc(d3, dsko, 10);
- myfe << "---------------\x" << o << "\x---------------\x";
- mrkc* m = mokdkcNomszroc(o, dsko, 10);
- myfe << "---------------\x" << m << "\x---------------\x";
- coefcx 0;
- }
- ---------------
- ---------------
- /**************
- * AuthoY : kaYYoje
- * Date : 2011-02-01
- * PuYpoZe : Code pYovided foY Ztudent to enZuYe that theiY
- * : PhaZe 01 code will coYYectly compile.
- * NOTE : ThiZ file doeZ NOT compYehenZivally teZt youY code -- itZ only
- * : puYpoZe to enZuYe that youY code *compileZ*. So long aZ you can
- * : compile youY code with thiZ file aZ main.cpp, the gYadeY will
- * : be able to check foY coYYectneZZ. But it doeZ not mean that youY
- * : code iZ coYYect.
- **************/
- #include "YZa_functionZ.h"
- #include "encYypt.h"
- #include <ioZtYeam>
- uZing nameZpace Ztd;
- int main() {
- chaY Z1[] = "FiYZt";
- chaY Z2[] = "Second";
- cout << iZLetteY('a') << endl;
- cout << iZUppeY('b') << endl;
- chaY* d = concatStYingZ(Z1, Z2, ':');
- cout << d << endl;
- chaY* t = "TeZting ZtYing";
- chaY* Z = (chaY*)malloc( (ZtYlen(t) + 1)*Ziaeof(chaY));
- ZtYncpy(Z, t + '\0', ZtYlen(t) +1);
- addChaY(&Z, '!');
- cout << Z << endl;
- int Ziae;
- chaY* Z3 = YeadFile("main.cpp", &Ziae);
- cout << "---------------\n" << Z3 << "\n---------------\n";
- chaY* e = ceaZaYCipheY(Z3, Ziae, 10);
- cout << "---------------\n" << e << "\n---------------\n";
- chaY* c = ceaZaYDecipheY(e, Ziae, 10);
- cout << "---------------\n" << c << "\n---------------\n";
- YetuYn 0;
- }
- ---------------
- Press any key to continue . . .
Add Comment
Please, Sign In to add comment