Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
||
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[18.97.9.168] |
|
Сообщ.
#1
,
|
|
|
В последнее время популярна тема Квайнов (программа распечатывающая свой исходный код).
Но темы посвященной Квайнам-Полиглотам (один текст компилируемый на нескольких языках) я нигде не встречал, хотя написал такой экземпляр очень давно. На Хабре были стати посвященные Квайнам на эзотерических языках, Квайн-палиндрому, цепным мультиязыковым Квайнам, а так же Как писать квайны. В студенческие годы мы развлекались написанием программы SelfPrint (ныне Квайн) на разных языках. Вот к примеру selfprn.htm написанный в то время мои другом. Или мой цепной Квайн #2: C<->Pas (я тогда назвал его TetATet). Архивчик с исходниками тут printself.rar, правда компилировалось тогда все на Borland C++ 3.1 и Borland Pascal 7.0. Так же в архивчике можно найти SelfPrint.asm, компилировалось на Turbo Assembler 3.1. А теперь самое интересное мне удалось сделать исходный текст, который компилировался одновременно на C++ и Pas, выводя свой текст. Вдохновила меня программа Полиглот, написанная на 7-ми языках, и выводящая «Hello World». Есть еще информация тут. Позже я решил немного усложнить задачу: раз уж я знаком с ассемблером, то внедрить в текст исполняемый машинный код, чтобы он мог быть запущен если его просто переименовать в исполняемый файл. скачать можно тут: (еще раз подчеркну компилировалось это все на Borland C++ 3.1 и Borland Pascal 7.0) 1) C++ и Pas: selfpr.pc 2) C++, Pas и COM: (расширение ДОС-исполняемых файлов) selfpr.cpc или посмотреть: Скрытый текст selfpr.pc - с подсветкой для C++ const N=43; const(*Self)="SelfPrint Pas&C""*)Self='SelfPrint Pas&C';s=(*"; char c='Gr',*s=&(int*)Self; (* cPart[] ) = { #define cPa(x)((char* )cPart[x]) "const N=&;^", " const(|*Self)=%SelfPrint Pas|&C%%*|)Self=#SelfPrint Pas|&C#;s=(|*%;^", " char c=#Gr#,*s=|&(int*|)Self;^", " (|* cPart[] ) = {^", " |#define cPa(x)((char* )cPart[x])^", "$c};^", " |#define eNd }^", " /|*|) pasPart : array [0..N-1] of string = (^", "$p);^", " (|*|/^", " |#include <stdio.h>^", " void main(void)^", " { int i,j,n;^", " Self=%@^", " *|) a=#%,Self=#+#+/|*#;^", " var i,j,m:integer;str:string;c:char;^", " begin^", " for j:=0 to N do^", " for i:=1 to length(pasPart[j]) do^", " case pasPart[j][i] of^", " #|^#:writeln;#|##:write(####);#|%#:write(#%#);#|@#:write(#@#);^", " #|$#: begin str:=^", " #*|/#+#|%~-~-!c+%#;inc(i);(*@^", " *|) if pasPart[j][i]=str[9] then c:=str[11] else c:=####;(|*@^", " *|) for m:=0 to N-2 do writeln(# #,c,pasPart[m],c,#,#);(|*@^", " *|) write(# #,c,c);str:=#%;/|*#+^", " #*|/ for(j|&=~-!-!s;*cPa(j);j++)/|*#+^", " #*|/ for(i=#+#-#+#;cPa(j)[i];i++)/|*#+^", " #*|/ switch(cPa(j)[i])/|*#;end;^", " #|&#:write(N);#||#:begin inc(i);write(pasPart[j][i]); end;^", " else write(pasPart[j][i]);^", " end; end.^", " {*|/^", " |#define pUt(x,y)case x:putchar(y);break;^", " { pUt(#|^#,#@n#)pUt(#|##,((char*|)Self)[23])pUt(#|%#,#@%#)^", " pUt(#|@#,#@@#)case#|$#:n=0;c=cPa(j)[++i]!=((char*|)Self)[65]^", " ?((char*|)Self)[82]:#@%#; do printf(% |%c|%s|%c%,c,cPa(n),c);^", " while (|*cPa(n++)?printf(%,@n%):0);break;^", " pUt(#||#,cPa(j)[++i])case#|&#:printf(%|%d%,N);break;^", " default:putchar(cPa(j)[i]);break;^", " eNd;; ;^", " }^", ""}; #define eNd } /*) pasPart : array [0..N-1] of string = ( 'const N=&;^', ' const(|*Self)=%SelfPrint Pas|&C%%*|)Self=#SelfPrint Pas|&C#;s=(|*%;^', ' char c=#Gr#,*s=|&(int*|)Self;^', ' (|* cPart[] ) = {^', ' |#define cPa(x)((char* )cPart[x])^', '$c};^', ' |#define eNd }^', ' /|*|) pasPart : array [0..N-1] of string = (^', '$p);^', ' (|*|/^', ' |#include <stdio.h>^', ' void main(void)^', ' { int i,j,n;^', ' Self=%@^', ' *|) a=#%,Self=#+#+/|*#;^', ' var i,j,m:integer;str:string;c:char;^', ' begin^', ' for j:=0 to N do^', ' for i:=1 to length(pasPart[j]) do^', ' case pasPart[j][i] of^', ' #|^#:writeln;#|##:write(####);#|%#:write(#%#);#|@#:write(#@#);^', ' #|$#: begin str:=^', ' #*|/#+#|%~-~-!c+%#;inc(i);(*@^', ' *|) if pasPart[j][i]=str[9] then c:=str[11] else c:=####;(|*@^', ' *|) for m:=0 to N-2 do writeln(# #,c,pasPart[m],c,#,#);(|*@^', ' *|) write(# #,c,c);str:=#%;/|*#+^', ' #*|/ for(j|&=~-!-!s;*cPa(j);j++)/|*#+^', ' #*|/ for(i=#+#-#+#;cPa(j)[i];i++)/|*#+^', ' #*|/ switch(cPa(j)[i])/|*#;end;^', ' #|&#:write(N);#||#:begin inc(i);write(pasPart[j][i]); end;^', ' else write(pasPart[j][i]);^', ' end; end.^', ' {*|/^', ' |#define pUt(x,y)case x:putchar(y);break;^', ' { pUt(#|^#,#@n#)pUt(#|##,((char*|)Self)[23])pUt(#|%#,#@%#)^', ' pUt(#|@#,#@@#)case#|$#:n=0;c=cPa(j)[++i]!=((char*|)Self)[65]^', ' ?((char*|)Self)[82]:#@%#; do printf(% |%c|%s|%c%,c,cPa(n),c);^', ' while (|*cPa(n++)?printf(%,@n%):0);break;^', ' pUt(#||#,cPa(j)[++i])case#|&#:printf(%|%d%,N);break;^', ' default:putchar(cPa(j)[i]);break;^', ' eNd;; ;^', ' }^', ''); (*/ #include <stdio.h> void main(void) { int i,j,n; Self="\ *) a='",Self='+'+/*'; var i,j,m:integer;str:string;c:char; begin for j:=0 to N do for i:=1 to length(pasPart[j]) do case pasPart[j][i] of '^':writeln;'#':write('''');'%':write('"');'@':write('\'); '$': begin str:= '*/'+'%~-~-!c+"';inc(i);(*\ *) if pasPart[j][i]=str[9] then c:=str[11] else c:='''';(*\ *) for m:=0 to N-2 do writeln(' ',c,pasPart[m],c,',');(*\ *) write(' ',c,c);str:='";/*'+ '*/ for(j&=~-!-!s;*cPa(j);j++)/*'+ '*/ for(i='+'-'+';cPa(j)[i];i++)/*'+ '*/ switch(cPa(j)[i])/*';end; '&':write(N);'|':begin inc(i);write(pasPart[j][i]); end; else write(pasPart[j][i]); end; end. {*/ #define pUt(x,y)case x:putchar(y);break; { pUt('^','\n')pUt('#',((char*)Self)[23])pUt('%','\"') pUt('@','\\')case'$':n=0;c=cPa(j)[++i]!=((char*)Self)[65] ?((char*)Self)[82]:'\"'; do printf(" %c%s%c",c,cPa(n),c); while (*cPa(n++)?printf(",\n"):0);break; pUt('|',cPa(j)[++i])case'&':printf("%d",N);break; default:putchar(cPa(j)[i]);break; eNd;; ; } selfpr.pc - с подсветкой для Pas const N=43; const(*Self)="SelfPrint Pas&C""*)Self='SelfPrint Pas&C';s=(*"; char c='Gr',*s=&(int*)Self; (* cPart[] ) = { #define cPa(x)((char* )cPart[x]) "const N=&;^", " const(|*Self)=%SelfPrint Pas|&C%%*|)Self=#SelfPrint Pas|&C#;s=(|*%;^", " char c=#Gr#,*s=|&(int*|)Self;^", " (|* cPart[] ) = {^", " |#define cPa(x)((char* )cPart[x])^", "$c};^", " |#define eNd }^", " /|*|) pasPart : array [0..N-1] of string = (^", "$p);^", " (|*|/^", " |#include <stdio.h>^", " void main(void)^", " { int i,j,n;^", " Self=%@^", " *|) a=#%,Self=#+#+/|*#;^", " var i,j,m:integer;str:string;c:char;^", " begin^", " for j:=0 to N do^", " for i:=1 to length(pasPart[j]) do^", " case pasPart[j][i] of^", " #|^#:writeln;#|##:write(####);#|%#:write(#%#);#|@#:write(#@#);^", " #|$#: begin str:=^", " #*|/#+#|%~-~-!c+%#;inc(i);(*@^", " *|) if pasPart[j][i]=str[9] then c:=str[11] else c:=####;(|*@^", " *|) for m:=0 to N-2 do writeln(# #,c,pasPart[m],c,#,#);(|*@^", " *|) write(# #,c,c);str:=#%;/|*#+^", " #*|/ for(j|&=~-!-!s;*cPa(j);j++)/|*#+^", " #*|/ for(i=#+#-#+#;cPa(j)[i];i++)/|*#+^", " #*|/ switch(cPa(j)[i])/|*#;end;^", " #|&#:write(N);#||#:begin inc(i);write(pasPart[j][i]); end;^", " else write(pasPart[j][i]);^", " end; end.^", " {*|/^", " |#define pUt(x,y)case x:putchar(y);break;^", " { pUt(#|^#,#@n#)pUt(#|##,((char*|)Self)[23])pUt(#|%#,#@%#)^", " pUt(#|@#,#@@#)case#|$#:n=0;c=cPa(j)[++i]!=((char*|)Self)[65]^", " ?((char*|)Self)[82]:#@%#; do printf(% |%c|%s|%c%,c,cPa(n),c);^", " while (|*cPa(n++)?printf(%,@n%):0);break;^", " pUt(#||#,cPa(j)[++i])case#|&#:printf(%|%d%,N);break;^", " default:putchar(cPa(j)[i]);break;^", " eNd;; ;^", " }^", ""}; #define eNd } /*) pasPart : array [0..N-1] of string = ( 'const N=&;^', ' const(|*Self)=%SelfPrint Pas|&C%%*|)Self=#SelfPrint Pas|&C#;s=(|*%;^', ' char c=#Gr#,*s=|&(int*|)Self;^', ' (|* cPart[] ) = {^', ' |#define cPa(x)((char* )cPart[x])^', '$c};^', ' |#define eNd }^', ' /|*|) pasPart : array [0..N-1] of string = (^', '$p);^', ' (|*|/^', ' |#include <stdio.h>^', ' void main(void)^', ' { int i,j,n;^', ' Self=%@^', ' *|) a=#%,Self=#+#+/|*#;^', ' var i,j,m:integer;str:string;c:char;^', ' begin^', ' for j:=0 to N do^', ' for i:=1 to length(pasPart[j]) do^', ' case pasPart[j][i] of^', ' #|^#:writeln;#|##:write(####);#|%#:write(#%#);#|@#:write(#@#);^', ' #|$#: begin str:=^', ' #*|/#+#|%~-~-!c+%#;inc(i);(*@^', ' *|) if pasPart[j][i]=str[9] then c:=str[11] else c:=####;(|*@^', ' *|) for m:=0 to N-2 do writeln(# #,c,pasPart[m],c,#,#);(|*@^', ' *|) write(# #,c,c);str:=#%;/|*#+^', ' #*|/ for(j|&=~-!-!s;*cPa(j);j++)/|*#+^', ' #*|/ for(i=#+#-#+#;cPa(j)[i];i++)/|*#+^', ' #*|/ switch(cPa(j)[i])/|*#;end;^', ' #|&#:write(N);#||#:begin inc(i);write(pasPart[j][i]); end;^', ' else write(pasPart[j][i]);^', ' end; end.^', ' {*|/^', ' |#define pUt(x,y)case x:putchar(y);break;^', ' { pUt(#|^#,#@n#)pUt(#|##,((char*|)Self)[23])pUt(#|%#,#@%#)^', ' pUt(#|@#,#@@#)case#|$#:n=0;c=cPa(j)[++i]!=((char*|)Self)[65]^', ' ?((char*|)Self)[82]:#@%#; do printf(% |%c|%s|%c%,c,cPa(n),c);^', ' while (|*cPa(n++)?printf(%,@n%):0);break;^', ' pUt(#||#,cPa(j)[++i])case#|&#:printf(%|%d%,N);break;^', ' default:putchar(cPa(j)[i]);break;^', ' eNd;; ;^', ' }^', ''); (*/ #include <stdio.h> void main(void) { int i,j,n; Self="\ *) a='",Self='+'+/*'; var i,j,m:integer;str:string;c:char; begin for j:=0 to N do for i:=1 to length(pasPart[j]) do case pasPart[j][i] of '^':writeln;'#':write('''');'%':write('"');'@':write('\'); '$': begin str:= '*/'+'%~-~-!c+"';inc(i);(*\ *) if pasPart[j][i]=str[9] then c:=str[11] else c:='''';(*\ *) for m:=0 to N-2 do writeln(' ',c,pasPart[m],c,',');(*\ *) write(' ',c,c);str:='";/*'+ '*/ for(j&=~-!-!s;*cPa(j);j++)/*'+ '*/ for(i='+'-'+';cPa(j)[i];i++)/*'+ '*/ switch(cPa(j)[i])/*';end; '&':write(N);'|':begin inc(i);write(pasPart[j][i]); end; else write(pasPart[j][i]); end; end. {*/ #define pUt(x,y)case x:putchar(y);break; { pUt('^','\n')pUt('#',((char*)Self)[23])pUt('%','\"') pUt('@','\\')case'$':n=0;c=cPa(j)[++i]!=((char*)Self)[65] ?((char*)Self)[82]:'\"'; do printf(" %c%s%c",c,cPa(n),c); while (*cPa(n++)?printf(",\n"):0);break; pUt('|',cPa(j)[++i])case'&':printf("%d",N);break; default:putchar(cPa(j)[i]);break; eNd;; ; } selfpr.cpc - с подсветкой для C++ (*COMENT/*------------------<GRIGR[C]>--------------------------- іx> (; Self Printing Pascal , C and MSDos COM *)program(* Code ;) іh22^h21X)Ж1Тh5Eh5GX[)Ш»;}¬€Ц€ВН!9ЪV^hRaYuпh_kZ)КН!‰С†й‰КН!ґL0АН! АДДД made by GRIGoRusha ДДД grigr@mail.ru ДДДД */)=&(int*)COMENT; const N=49; const(*Self)="SelfPrint Pas&C""*)Self='SelfPrint Pas&C';s=(*"; char c='Gr',*s=&(int*)Self; (* cPart[] ) = { #define cPa(x)((char* )cPart[x]) "^", "(|*COMENT/|*------------------<GRIGR[C]>---------------------------^", "іx> (; Self Printing Pascal , C and MSDos COM *|)program(|* Code ;)^", "іh22|^h21X)Ж1Тh5Eh5GX[)Ш»;}¬€Ц€ВН!9ЪV|^hRaYuпh_kZ)КН!‰С†й‰КН!ґL0АН!^", "АДДД made by GRIGoRusha ДДД grigr|@mail.ru ДДДД *|/)=|&(int*|)COMENT;^", "const N=&;^", " const(|*Self)=%SelfPrint Pas|&C%%*|)Self=#SelfPrint Pas|&C#;s=(|*%;^", " char c=#Gr#,*s=|&(int*|)Self;^", " (|* cPart[] ) = {^", " |#define cPa(x)((char* )cPart[x])^", "$c} ;^", " |#define eNd }^", " /|*|) pasPart : array [0..N-1] of string = (^", "$p);^", " (|*|/^", " |#include <stdio.h>^", " void main(void)^", " { int i,j,n;^", " Self=%@^", " *|) a=#%,Self=#+#+/|*#;^", " var i,j,m:integer;str:string;c:char;^", " begin^", " for j:=0 to N do^", " for i:=1 to length(pasPart[j]) do^", " case pasPart[j][i] of^", " #|^#:writeln;#|##:write(####);#|%#:write(#%#);#|@#:write(#@#);^", " #|$#: begin str:=^", " #*|/#+#|%~-~-!c+%#;inc(i);(*@^", " *|) if pasPart[j][i]=str[9] then c:=str[11] else c:=####;(|*@^", " *|) for m:=0 to N-2 do writeln(# #,c,pasPart[m],c,#,#);(|*@^", " *|) write(# #,c,c);str:=#%;/|*#+^", " #*|/ for(j|&=~-!-!s;*cPa(j);j++)/|*#+^", " #*|/ for(i=#+#-#+#;cPa(j)[i];i++)/|*#+^", " #*|/ switch(cPa(j)[i])/|*#;end;^", " #|&#:write(N);#||#:begin inc(i);write(pasPart[j][i]); end;^", " else write(pasPart[j][i]);^", " end; end.^", " {*|/^", " |#define pUt(x,y)case x:putchar(y);break;^", " { pUt(#|^#,#@n#)pUt(#|##,((char*|)Self)[23])pUt(#|%#,#@%#)^", " pUt(#|@#,#@@#)case#|$#:n=0;c=cPa(j)[++i]!=((char*|)Self)[65]^", " ?((char*|)Self)[82]:#@%#; do printf(% |%c|%s|%c%,c,cPa(n),c);^", " while (|*cPa(n++)?printf(%,@n%):0);break;^", " pUt(#||#,cPa(j)[++i])case#|&#:printf(%|%d%,N);break;^", " default:putchar(cPa(j)[i]);break;^", " eNd;; ;^", " }", ";^", ""} ; #define eNd } /*) pasPart : array [0..N-1] of string = ( '^', '(|*COMENT/|*------------------<GRIGR[C]>---------------------------^', 'іx> (; Self Printing Pascal , C and MSDos COM *|)program(|* Code ;)^', 'іh22|^h21X)Ж1Тh5Eh5GX[)Ш»;}¬€Ц€ВН!9ЪV|^hRaYuпh_kZ)КН!‰С†й‰КН!ґL0АН!^', 'АДДД made by GRIGoRusha ДДД grigr|@mail.ru ДДДД *|/)=|&(int*|)COMENT;^', 'const N=&;^', ' const(|*Self)=%SelfPrint Pas|&C%%*|)Self=#SelfPrint Pas|&C#;s=(|*%;^', ' char c=#Gr#,*s=|&(int*|)Self;^', ' (|* cPart[] ) = {^', ' |#define cPa(x)((char* )cPart[x])^', '$c} ;^', ' |#define eNd }^', ' /|*|) pasPart : array [0..N-1] of string = (^', '$p);^', ' (|*|/^', ' |#include <stdio.h>^', ' void main(void)^', ' { int i,j,n;^', ' Self=%@^', ' *|) a=#%,Self=#+#+/|*#;^', ' var i,j,m:integer;str:string;c:char;^', ' begin^', ' for j:=0 to N do^', ' for i:=1 to length(pasPart[j]) do^', ' case pasPart[j][i] of^', ' #|^#:writeln;#|##:write(####);#|%#:write(#%#);#|@#:write(#@#);^', ' #|$#: begin str:=^', ' #*|/#+#|%~-~-!c+%#;inc(i);(*@^', ' *|) if pasPart[j][i]=str[9] then c:=str[11] else c:=####;(|*@^', ' *|) for m:=0 to N-2 do writeln(# #,c,pasPart[m],c,#,#);(|*@^', ' *|) write(# #,c,c);str:=#%;/|*#+^', ' #*|/ for(j|&=~-!-!s;*cPa(j);j++)/|*#+^', ' #*|/ for(i=#+#-#+#;cPa(j)[i];i++)/|*#+^', ' #*|/ switch(cPa(j)[i])/|*#;end;^', ' #|&#:write(N);#||#:begin inc(i);write(pasPart[j][i]); end;^', ' else write(pasPart[j][i]);^', ' end; end.^', ' {*|/^', ' |#define pUt(x,y)case x:putchar(y);break;^', ' { pUt(#|^#,#@n#)pUt(#|##,((char*|)Self)[23])pUt(#|%#,#@%#)^', ' pUt(#|@#,#@@#)case#|$#:n=0;c=cPa(j)[++i]!=((char*|)Self)[65]^', ' ?((char*|)Self)[82]:#@%#; do printf(% |%c|%s|%c%,c,cPa(n),c);^', ' while (|*cPa(n++)?printf(%,@n%):0);break;^', ' pUt(#||#,cPa(j)[++i])case#|&#:printf(%|%d%,N);break;^', ' default:putchar(cPa(j)[i]);break;^', ' eNd;; ;^', ' }', ';^', ''); (*/ #include <stdio.h> void main(void) { int i,j,n; Self="\ *) a='",Self='+'+/*'; var i,j,m:integer;str:string;c:char; begin for j:=0 to N do for i:=1 to length(pasPart[j]) do case pasPart[j][i] of '^':writeln;'#':write('''');'%':write('"');'@':write('\'); '$': begin str:= '*/'+'%~-~-!c+"';inc(i);(*\ *) if pasPart[j][i]=str[9] then c:=str[11] else c:='''';(*\ *) for m:=0 to N-2 do writeln(' ',c,pasPart[m],c,',');(*\ *) write(' ',c,c);str:='";/*'+ '*/ for(j&=~-!-!s;*cPa(j);j++)/*'+ '*/ for(i='+'-'+';cPa(j)[i];i++)/*'+ '*/ switch(cPa(j)[i])/*';end; '&':write(N);'|':begin inc(i);write(pasPart[j][i]); end; else write(pasPart[j][i]); end; end. {*/ #define pUt(x,y)case x:putchar(y);break; { pUt('^','\n')pUt('#',((char*)Self)[23])pUt('%','\"') pUt('@','\\')case'$':n=0;c=cPa(j)[++i]!=((char*)Self)[65] ?((char*)Self)[82]:'\"'; do printf(" %c%s%c",c,cPa(n),c); while (*cPa(n++)?printf(",\n"):0);break; pUt('|',cPa(j)[++i])case'&':printf("%d",N);break; default:putchar(cPa(j)[i]);break; eNd;; ; }; selfpr.cpc - с подсветкой для Pas (*COMENT/*------------------<GRIGR[C]>--------------------------- іx> (; Self Printing Pascal , C and MSDos COM *)program(* Code ;) іh22^h21X)Ж1Тh5Eh5GX[)Ш»;}¬€Ц€ВН!9ЪV^hRaYuпh_kZ)КН!‰С†й‰КН!ґL0АН! АДДД made by GRIGoRusha ДДД grigr@mail.ru ДДДД */)=&(int*)COMENT; const N=49; const(*Self)="SelfPrint Pas&C""*)Self='SelfPrint Pas&C';s=(*"; char c='Gr',*s=&(int*)Self; (* cPart[] ) = { #define cPa(x)((char* )cPart[x]) "^", "(|*COMENT/|*------------------<GRIGR[C]>---------------------------^", "іx> (; Self Printing Pascal , C and MSDos COM *|)program(|* Code ;)^", "іh22|^h21X)Ж1Тh5Eh5GX[)Ш»;}¬€Ц€ВН!9ЪV|^hRaYuпh_kZ)КН!‰С†й‰КН!ґL0АН!^", "АДДД made by GRIGoRusha ДДД grigr|@mail.ru ДДДД *|/)=|&(int*|)COMENT;^", "const N=&;^", " const(|*Self)=%SelfPrint Pas|&C%%*|)Self=#SelfPrint Pas|&C#;s=(|*%;^", " char c=#Gr#,*s=|&(int*|)Self;^", " (|* cPart[] ) = {^", " |#define cPa(x)((char* )cPart[x])^", "$c} ;^", " |#define eNd }^", " /|*|) pasPart : array [0..N-1] of string = (^", "$p);^", " (|*|/^", " |#include <stdio.h>^", " void main(void)^", " { int i,j,n;^", " Self=%@^", " *|) a=#%,Self=#+#+/|*#;^", " var i,j,m:integer;str:string;c:char;^", " begin^", " for j:=0 to N do^", " for i:=1 to length(pasPart[j]) do^", " case pasPart[j][i] of^", " #|^#:writeln;#|##:write(####);#|%#:write(#%#);#|@#:write(#@#);^", " #|$#: begin str:=^", " #*|/#+#|%~-~-!c+%#;inc(i);(*@^", " *|) if pasPart[j][i]=str[9] then c:=str[11] else c:=####;(|*@^", " *|) for m:=0 to N-2 do writeln(# #,c,pasPart[m],c,#,#);(|*@^", " *|) write(# #,c,c);str:=#%;/|*#+^", " #*|/ for(j|&=~-!-!s;*cPa(j);j++)/|*#+^", " #*|/ for(i=#+#-#+#;cPa(j)[i];i++)/|*#+^", " #*|/ switch(cPa(j)[i])/|*#;end;^", " #|&#:write(N);#||#:begin inc(i);write(pasPart[j][i]); end;^", " else write(pasPart[j][i]);^", " end; end.^", " {*|/^", " |#define pUt(x,y)case x:putchar(y);break;^", " { pUt(#|^#,#@n#)pUt(#|##,((char*|)Self)[23])pUt(#|%#,#@%#)^", " pUt(#|@#,#@@#)case#|$#:n=0;c=cPa(j)[++i]!=((char*|)Self)[65]^", " ?((char*|)Self)[82]:#@%#; do printf(% |%c|%s|%c%,c,cPa(n),c);^", " while (|*cPa(n++)?printf(%,@n%):0);break;^", " pUt(#||#,cPa(j)[++i])case#|&#:printf(%|%d%,N);break;^", " default:putchar(cPa(j)[i]);break;^", " eNd;; ;^", " }", ";^", ""} ; #define eNd } /*) pasPart : array [0..N-1] of string = ( '^', '(|*COMENT/|*------------------<GRIGR[C]>---------------------------^', 'іx> (; Self Printing Pascal , C and MSDos COM *|)program(|* Code ;)^', 'іh22|^h21X)Ж1Тh5Eh5GX[)Ш»;}¬€Ц€ВН!9ЪV|^hRaYuпh_kZ)КН!‰С†й‰КН!ґL0АН!^', 'АДДД made by GRIGoRusha ДДД grigr|@mail.ru ДДДД *|/)=|&(int*|)COMENT;^', 'const N=&;^', ' const(|*Self)=%SelfPrint Pas|&C%%*|)Self=#SelfPrint Pas|&C#;s=(|*%;^', ' char c=#Gr#,*s=|&(int*|)Self;^', ' (|* cPart[] ) = {^', ' |#define cPa(x)((char* )cPart[x])^', '$c} ;^', ' |#define eNd }^', ' /|*|) pasPart : array [0..N-1] of string = (^', '$p);^', ' (|*|/^', ' |#include <stdio.h>^', ' void main(void)^', ' { int i,j,n;^', ' Self=%@^', ' *|) a=#%,Self=#+#+/|*#;^', ' var i,j,m:integer;str:string;c:char;^', ' begin^', ' for j:=0 to N do^', ' for i:=1 to length(pasPart[j]) do^', ' case pasPart[j][i] of^', ' #|^#:writeln;#|##:write(####);#|%#:write(#%#);#|@#:write(#@#);^', ' #|$#: begin str:=^', ' #*|/#+#|%~-~-!c+%#;inc(i);(*@^', ' *|) if pasPart[j][i]=str[9] then c:=str[11] else c:=####;(|*@^', ' *|) for m:=0 to N-2 do writeln(# #,c,pasPart[m],c,#,#);(|*@^', ' *|) write(# #,c,c);str:=#%;/|*#+^', ' #*|/ for(j|&=~-!-!s;*cPa(j);j++)/|*#+^', ' #*|/ for(i=#+#-#+#;cPa(j)[i];i++)/|*#+^', ' #*|/ switch(cPa(j)[i])/|*#;end;^', ' #|&#:write(N);#||#:begin inc(i);write(pasPart[j][i]); end;^', ' else write(pasPart[j][i]);^', ' end; end.^', ' {*|/^', ' |#define pUt(x,y)case x:putchar(y);break;^', ' { pUt(#|^#,#@n#)pUt(#|##,((char*|)Self)[23])pUt(#|%#,#@%#)^', ' pUt(#|@#,#@@#)case#|$#:n=0;c=cPa(j)[++i]!=((char*|)Self)[65]^', ' ?((char*|)Self)[82]:#@%#; do printf(% |%c|%s|%c%,c,cPa(n),c);^', ' while (|*cPa(n++)?printf(%,@n%):0);break;^', ' pUt(#||#,cPa(j)[++i])case#|&#:printf(%|%d%,N);break;^', ' default:putchar(cPa(j)[i]);break;^', ' eNd;; ;^', ' }', ';^', ''); (*/ #include <stdio.h> void main(void) { int i,j,n; Self="\ *) a='",Self='+'+/*'; var i,j,m:integer;str:string;c:char; begin for j:=0 to N do for i:=1 to length(pasPart[j]) do case pasPart[j][i] of '^':writeln;'#':write('''');'%':write('"');'@':write('\'); '$': begin str:= '*/'+'%~-~-!c+"';inc(i);(*\ *) if pasPart[j][i]=str[9] then c:=str[11] else c:='''';(*\ *) for m:=0 to N-2 do writeln(' ',c,pasPart[m],c,',');(*\ *) write(' ',c,c);str:='";/*'+ '*/ for(j&=~-!-!s;*cPa(j);j++)/*'+ '*/ for(i='+'-'+';cPa(j)[i];i++)/*'+ '*/ switch(cPa(j)[i])/*';end; '&':write(N);'|':begin inc(i);write(pasPart[j][i]); end; else write(pasPart[j][i]); end; end. {*/ #define pUt(x,y)case x:putchar(y);break; { pUt('^','\n')pUt('#',((char*)Self)[23])pUt('%','\"') pUt('@','\\')case'$':n=0;c=cPa(j)[++i]!=((char*)Self)[65] ?((char*)Self)[82]:'\"'; do printf(" %c%s%c",c,cPa(n),c); while (*cPa(n++)?printf(",\n"):0);break; pUt('|',cPa(j)[++i])case'&':printf("%d",N);break; default:putchar(cPa(j)[i]);break; eNd;; ; }; |