GamerSK

advanced sifra

Feb 11th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1.     AnsiString str = InputBox("Zadajte text, ktorĂ˝ chcete zasifrovat","text","");
  2.     ofstream f;
  3.     f.open("advanced-sifra.txt");
  4.     AnsiChar c;
  5.     Label3->Caption = "";
  6.     for ( int i = 1; i <= str.Length(); i++ ) {
  7.         c = str[i]+i+2;
  8.         f.put(c);
  9.         Label3->Caption=Label3->Caption + c;
  10.     }
  11.     f.close();
  12.     ifstream l;
  13.     l.open("advanced-sifra.txt");
  14.     int i = 1;
  15.     if (l.fail()) {
  16.         ShowMessage("Chyba pri otvarani");
  17.     } else {
  18.         Label2->Caption = "";
  19.         c = l.get() - i - 2;
  20.         while ( l.good() ) {
  21.             i++;
  22.             Label2->Caption=Label2->Caption + c;
  23.             c = l.get() - i - 2;
  24.         }
  25.     }
  26.     l.close();
Advertisement
Add Comment
Please, Sign In to add comment