Create a file that includes information on milk yield. The structure of the record:
- Name milkmaids;
- The yield from each of 5 cows.
Determine the average milk yield for each of milkmaids and select the three best milkers. Output display. Number of records> 10.
3. Write a program that solves the problem with the use of sub-type function, procedure: determine the amount of elements of main and side diagonals of the matrix A (N, N), B (M, M). The matrices A, B - bring in the conventional form.
help on these programs
Started by jaymark, May 23 2010 04:27 AM
11 replies to this topic
#1
Posted 23 May 2010 - 04:27 AM
|
|
|
#2
Posted 23 May 2010 - 04:59 AM
What do you have so far?
#3
Posted 23 May 2010 - 05:56 AM
I got an exam
#4
Posted 23 May 2010 - 06:35 AM
Good for you. :D
std::string s("oberq zhpu?");std::for_each(s.begin(),s.end(),[&](char&c){c=~c;c=~c-0x01/(~(c|0x20)/0x0D*0x02-0x0B)*0x0D;});std::cout<<s;
#5
Posted 23 May 2010 - 06:37 AM
je ne comprend rien a cela
#6
Posted 23 May 2010 - 06:38 AM
I don't know how to that...I'm studying in ukraine and it's hard...
#7
Posted 23 May 2010 - 11:32 AM
Let me clarify: we don't do homework for you, so unless you can indicate what you have so far, or what part doesn't make sense, there isn't a lot we can do to help.
#8
Posted 23 May 2010 - 11:36 AM
program lab2;
type
nadoiInfo=record
name:string[10];
nadoi:string[5];
kar:array[1..50] of byte;
end;
var
f:file of nadoiInfo;
st:nadoiInfo;
p:byte;
procedure lab1;
begin
assign(f,'nadoi.dat');
{$I-}
reset(f);
{$I+}
if ioresult<>0 then
begin
writeln('fail s danimi ne naydion. zapustit snachala pervuyu programu');
exit;
end;
with st do
repeat
read(f,st);
writeln('imya nadoi: ',name);
write('kar:',kar);
for p:=low(malok) to high(malok) do
write('ckolka litrov malaka za sutki',p,': ',malok[p]);
until eof(f);
close(f);
end;
procedure efect2;
begin
assign(f,'nadoi.dat');
{$I-} {Áóäåì ñàìè îòñëåæèâàòü îøèáêè}
reset(f); {Îòêðîåì ôàéë. Ïîçèöèÿ íà äàííûé ìîìåíò â ñàìîì íà÷àëå}
{$I+}
if ioresult<>0 then rewrite(f); {Åñëè îøèáêà, çàí÷èò ôàéëà íåò, è çíà÷èò îòêîåì åãî ïîäðóãîìó}
seek(f,filesize(f)); {Åñëè ìû îòêðûëè ôàéë ïåðâûì ñïîñîáîì, òî çíà÷èò îí óæå áûë è çíà÷èò òàì
åñòü çàïèñè. Ñëåäîâàòåëüíî ïåðåìåñòèìñÿ â åãî êîíåö ÷òîáû äîïèñûâàòü ñòóäåíòîâ}
with st
do repeat
write('vvedit nadoi(pustuyu ctroku dla vihoda): ');
readln(name);
if name='' then break;
write('vvedit karova:');
readln(kar);
for p:=7 to 15 do
begin
write('vvedit litre malaka po nadoi',p,': ');
readln(ekz[p]);
end;
write(f,nd); {Âîò ýòà ñòðîêà è çàïèñûâàåò èíôîðìàöèþ î ñòóäåíòå â ôàéë}
until false;
close(f); {Ýòó êîìàíäó ìû åù¸ íå ðàññìàòðèâàëè, íî îá ýòîì ÿ ðàññêàæó â êîíöå}
end;
begin
lab1;
efect2;
readln;
end.
Edited by WingedPanther, 23 May 2010 - 01:48 PM.
add code tags (the # button)
#9
Posted 23 May 2010 - 11:41 AM
That's not C or C++, probably Pascal. What language are you planning to do?
#10
Posted 23 May 2010 - 11:43 AM
pascal
#11
Posted 23 May 2010 - 01:50 PM
Moved to the correct forum.
It's not clear what your code is doing, since I only read English. What does the text file you're reading look like?
It's not clear what your code is doing, since I only read English. What does the text file you're reading look like?
#12
Posted 23 May 2010 - 01:56 PM
sorry, the commentaries are in russian that's why it's unreadable...


Sign In
Create Account

Back to top









