Joined: Fri Nov 21, 2008 6:18 pm Posts: 51 Location: thessaloniki Has thanked: 0 time Have thanks: 2 time
i ve develop a project in pascal but cant make a conversion to c ....
Code:
program shfrovalka; uses crt; var text:string; m,k,c,men:integer; procedure cez(var text:string; var k:integer); begin clrscr; writeln('vvedite isxodniy text '); write('$~/> '); read(text); write('vvedite klu4 shifrovani9 '); readln(k); for m:=1 to length(text) do begin c:=ord(text[m])+k; if c>256 then c:=c-256; text[m]:=chr(c); end; end; procedure desh (var text:string); begin writeln('vvedite kluch deshifrovki' ); readln(k); for m:=1 to length(text) do begin c:=ord(text[m])-k; if c<256 then c:=c+256; text[m]:=chr(c); end; end; begin repeat clrscr; writeln('1 - shifrovka '); writeln('2 - deshifrovka '); writeln('3 - sosto9nie texta '); readln(men); case men of 1:cez(text,k); 2:desh(text); U? 3:begin writeln(text); readkey; end; end; until men = 0; end.
_________________ if you want make an effort yourself no one will make it for you... best regards
Last edited by msi_333 on Wed Nov 26, 2008 1:25 am, edited 1 time in total.
title changed .
msi_333
Question subject: Re: can anyone convert this pascal code to c ?
Posted: Wed Nov 26, 2008 1:24 am
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2103 Location: Earth Has thanked: 39 time Have thanks: 56 time
Code:
http://www.garret.ru/ptoc/Readme.htm
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )