GOLFY_S Posted October 3, 2004 Report Share Posted October 3, 2004 huh, saaku pildiit 1. laboratotijas darbu programmesanaa (ar TP) un taa kaa es NEKO ( ) nerubiju, radas jautaajums par uzdevumu : Ievadīt divus lielumus a un b, Noteikt, vai šiem lielumiem ir vienādas zīmes. Ja kaut viens lielums ir 0 izvadīt attiecīgu paziņojumu. kaa ir jaarakasta, lai noteiku, vai lielumiem ir vienaadas ziimes?? tnx. Link to comment Share on other sites More sharing options...
Guest blody Posted October 3, 2004 Report Share Posted October 3, 2004 TP jau nebuus Pascal vai q-basic vai Visual basic? taadaa gadiijumaa neko nevaru paliidzeet Link to comment Share on other sites More sharing options...
GOLFY_S Posted October 3, 2004 Author Report Share Posted October 3, 2004 irir vecais labais turbo paskals Link to comment Share on other sites More sharing options...
x3m Posted October 3, 2004 Report Share Posted October 3, 2004 kkas liidziigs c++: if a>0 k=1 if b>0 l=1 if a<0 k=-1 if b<0 l=-1 if a=0 k=0 if b=0 l=0 if k=l cout<<"Ziimes ir vienaadas" Link to comment Share on other sites More sharing options...
macho Posted October 3, 2004 Report Share Posted October 3, 2004 ak vai, es paskaala sintaksi galiigi buushu piemirsis hehe, parakaajos pa savu veel neizdzeesto paskaala direktoriju un atradu savu superdarbu. (ja kaadu interesee tad attached fails). Vispaar jau baigais suuds, lai gan tur ir paaris veertiigas lietas. Nu a kas attiecas uz tavu briinumu tad... program bwleee; uses crt; var a,b:integer; begin clrscr; writeln('esi forshs un ievadi forshu ciparu'); readln(a); writeln('tas bija tik forshi ka es gribu veelvienu'); readln(b); if (a=0) or (b=0) then writeln ('Viens no forshajiem cipariem ir nulle ;-PP') else begin if (a<0) and (b<0) or ((a>0) and (b>0)) then writeln('Forshajiem cipariem IR vienaadas ziimes :-)') else writeln('Forshajiem cipariem nav vienaadas ziimes :-('); end; readln; end. eksmis lola, tur vienkaarshi vajag apskatiities vai vinji abi ir lielaaki vai mazaaki par nulli. Jaasaraksta iffi vienkaarshi. Es pienjeemu ka, ja viens ir nulle, tad vinsh neizvada pazinjojumu par ziimeem negaidi tik ka es rakstiishu visas tavas programmas es vienkaarshi gribeeju acereeties kaa tas bija paskaalaa. Klausies vien stundaas ciitiigi. YAAY.txt Link to comment Share on other sites More sharing options...
sulik Posted October 3, 2004 Report Share Posted October 3, 2004 un kur tad atstarpiites atstarpiites... Link to comment Share on other sites More sharing options...
macho Posted October 3, 2004 Report Share Posted October 3, 2004 ak dievs, vinjam tak kodu vajadzeeja nevis labu stilu nu jaa, ja raksti lielaaku programmu tad raksti visu smuki ar atstarpeem (tai pashaa yaay suudaa man liekas ir atstarpes (tur man naacaas toreiz uztaisiit jo citaadi taa programma bija vienkaarshi nelasaama)) Link to comment Share on other sites More sharing options...
GOLFY_S Posted October 3, 2004 Author Report Share Posted October 3, 2004 tnx, es jau tik nebiju iebraucis, ka tie a><=0 bij taa, saliidzinot jaraxta, paareejo jau +- no lekcijaam buutu uzraxtijis Link to comment Share on other sites More sharing options...
sulik Posted October 3, 2004 Report Share Posted October 3, 2004 labi, es piesakos tad nakoshajam lab.d palidzeet. Link to comment Share on other sites More sharing options...
Guest blody Posted October 3, 2004 Report Share Posted October 3, 2004 (edited) lool vaidzeetu arii man kaadu no saveejeim ubertekstiem iemest, hm... iemetiishu vienu pie kura tagad straadaaju kursos(jaa juus pareizi izlasiijaat, jo 9 klasee veel nemaaca pascal:( vop6im sitaa ir domaata kaa spoguljefekts , aplja centraa uzzimee triistuuri un pie taa malaam saliek citus un izveidojas se6stuuris , ja kauko uzzimee vienaa plaknee tad tas pats atspoguljojas blakus(itkaa pavairo) - taada ir ideja , pagaidaam esmu ticis tikai tik taalu gruuts maita program spogulis; uses crt,graph; procedure iesledzgrafiku; var gd,gm:integer; begin gd:=detect; gm:=0; initgraph(gd,gm,'d:\bp\bgi'); end; procedure mala1(xsturis,ysturis,malasgarums:integer;var x,y:integer); begin x:=xsturis+random(malasgarums+1); y:=ysturis; end; procedure mala2(xsturis,ysturis,malasgarums:integer;var x,y:integer); begin x:=xsturis; y:=ysturis+random(malasgarums+1); end; procedure mala3(xsturis,ysturis,malasgarums:integer;var x,y:integer); begin x:=xsturis+random(malasgarums+1); y:=ysturis+malasgarums; end; procedure mala4(xsturis,ysturis,malasgarums:integer;var x,y:integer); begin x:=xsturis+malasgarums; y:=ysturis+random(malasgarums+1); end; function yspogulis(xsturis,malasgarums,x:integer):integer; begin yspogulis:=2*(xsturis+malasgarums)-x; end; function xspogulis(ysturis,malasgarums,y:integer):integer; begin xspogulis:=2*(ysturis+malasgarums)-y; end; procedure aizkraso(xsturis,ysturis,malasgarums:integer); var i,punktsx,punktsy,krasa:integer; begin for i:=1 to 5000 do begin punktsx:=xsturis+1+random(malasgarums-1); punktsy:=ysturis+1+random(malasgarums-1); krasa:=1+random(15); setfillstyle(1,krasa); floodfill(punktsx,punktsy,15); floodfill(yspogulis(xsturis,malasgarums,punktsx),punktsy,15); floodfill(punktsx,xspogulis(ysturis,malasgarums,punktsy),15); floodfill(yspogulis(xsturis,malasgarums,punktsx),xspogulis(ysturis,malasgarums,punktsy),15); end; end; var xr,yr,xs,ys,a,x1,y1,x2,y2:integer; savieno1, savieno2:byte; begin randomize; writeln('Ievadi kvadraata kreisaa augsh. stuura koord. un malas garumu!'); readln(xs,ys,a); iesledzgrafiku; rectangle(xs,ys,xs+a,ys+a); {uzziimee kvadraatu} rectangle(xs+a,ys,xs+a+a,ys+a); {uzziimee spogul-kvadraatu} rectangle(xs,ys+a,xs+a,ys+a+a);{uzziimee 2spogul-kvadraatu} rectangle(xs+a,ys+a,xs+a+a,ys+a+a);{uzziimee 3spogul-kvadraatu} repeat xr:=random(4)+1; yr:=random(4)+1; case xr of 1:mala1(xs,ys,a,x1,y1); 3:mala3(xs,ys,a,x1,y1); end; case yr of 2:mala2(xs,ys,a,x2,y2); 4:mala4(xs,ys,a,x2,y2); end; line(x1,y1,x2,y2); line(yspogulis(xs,a,x1),y1,yspogulis(xs,a,x2),y2); line(x1,xspogulis(ys,a,y1),x2,xspogulis(ys,a,y2)); line(yspogulis(xs,a,x1),xspogulis(ys,a,y1),yspogulis(xs,a,x2),xspogulis(ys,a,y2)); delay(100); until readkey=#27; aizkraso(xs,ys,a); readln; closegraph; end. Edited October 3, 2004 by blody Link to comment Share on other sites More sharing options...
macho Posted October 3, 2004 Report Share Posted October 3, 2004 nu redz, tieshi par shaadiem es domaaju kad teicu ka vajag rakstiit labajaa stilaa. Taa programma ir gandriiz vai nelasaama, uztaisot visu smuki ar atstarpeem vinja buutu ljoti smukinja ~_0 Link to comment Share on other sites More sharing options...
Dr. Pain Posted October 4, 2004 Report Share Posted October 4, 2004 tiiri ieteikums. apskati skaitlju reizinaajumu. Ja tas ir 0, tad kaut viens no tiem ir 0, ja reizinaajums >0, tad skaitljiem vienaadas ziimes, ja <0, tad dazhaadas. uzreiz forshi case var izmantot. Link to comment Share on other sites More sharing options...
macho Posted October 4, 2004 Report Share Posted October 4, 2004 mm jaa taa arii var. Es pat teiktu ka taa buutu nedaudz gudraak Link to comment Share on other sites More sharing options...
sulik Posted October 4, 2004 Report Share Posted October 4, 2004 gudraak varbuut, bet skaitlju reizinashana prasa procesora laiku un arii vairaak resursu. protams uz musdienu datoriem tas taa kaa nav manaams, un arii shi tik niecigai programmai tas neko nenozimetu, bet uz vacakiem sudiem vai arii programmaas, kur shadi vajadzetu apstradat lielaku skaitlju daudzumu un arii pashus skaitljus lielakus, tad es personigi dotu priekshroku salidzinashanai, kas varetu buut vienkarshaka procesoram neka reizinashana. bet nu ko lai es zinu.. neesmu normali programejis jau cik sen. Link to comment Share on other sites More sharing options...
krish Posted October 4, 2004 Report Share Posted October 4, 2004 1) ja vien tu neprogramme datubazes dzineeju, kas paredzeets gigantiskiem datiem, tad tasi vienkarsako variantu un buus mazaka iespeeja kludities. 2) manupraat, salidzinasanas variants ir labaaks, jo reizinasana uzdevumaa galigi nav vajadziiga. Sareiznaat -12343124 ar 23130000 daudz reiz grutaak nekaa noteikt ziimes, ko procesors izdara nolasot pirmo skaitlja bitu... Link to comment Share on other sites More sharing options...
Teddy Posted October 4, 2004 Report Share Posted October 4, 2004 neko no taa nesapratu... Jums taa forsh bazars Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now