Activity 1 chware for free
Session 5.5 The need for copyright
221
cachia has just bought a new laptop from All Computer Supplies. She knows that an operating system has been installed on the computer
at doesn't include any word processing, spreadsheet, database or presentation software. Junaid at All Computer Supplies has told her
mat he can obtain all the software she needs from a well-known company. A friend of Zaphira's has emailed her to say that she can copy his
gure the reply that Zaphira should send to her friend. Include:
the reason why she should not accept her friend's offer of a copy of the software
an explanation to her friend of how he should check that the software he has is genuine.
for i:=1 to n do beginread(input,ar[i]);ts:=ts+2*ar[i];end;
if ts<a then writeln(output,'-1') else
begin
ara[1]:=3;for i:=2 to 15 do begin ara[i]:=3*ara[i-1];end;
for i:=1 to ara[n] do begin if arq[n]<2 then begin inc(arq[n]);sum:=sum+ar[n];inc(nm); end else begin g:=n;while arq[g]>1 do begin sum:=sum-ar[g]*arq[g];dec(nm,arq[g]);arq[g]:=0;dec(g);end;
inc(arq[g]);sum:=sum+ar[g];inc(nm);end;if sum=a then begin if nm<ans then ans:=nm;end;end;
if ans>1000 then writeln(output,'0') else writeln(output,ans); end;
close(output);close(input);end.
var x,y:array[1..n] of real; i:integer; t:boolean;
begin
for i:=1 to n do read(x[i]);
for i:=1 to n do if x[i]>m then y[i]:=x[i];
t:=true;
while t do begin
t:=false;
for i:=1 to n-1 do if ((y[i]<=m) or (y[i]>y[i+1])) and (y[i+1]>m) then begin
t:=true;
y[i]:=y[i]+y[i+1]; y[i+1]:=y[i]-y[i+1]; y[i]:=y[i]-y[i+1]
end
end;
for i:=1 to n do if y[i]>m then write(y[i],' ') else break;
writeln;
for i:=1 to n-1 do begin
if y[i]<=m then break;
if y[i]=y[i+1] then begin
if t=false then begin t:=true; write(i,' ') end;
write(i+1,' ') end
else t:=false
end
end.