1,
I have to find the leap year.
Var
iPrime,range,i,y: integer;
prime: boolean;
Begin
clrscr;
readln(i);
for y:=1 to i do
Begin
readln(iprime);
if (iprime=100) then
prime := false
else if iprime mod 4 = 0 then prime := true;
end;
for y:= 1 to i do
begin
if prime = true then writeln ('1')
else writeln('0');
end;
readln;
can anyone tell me why is it not working? and if possible can anyone give me a solution to the problem?2, there is something wrong with this program too,
Given N characters , 'A' to'F', Print how many A has, then B, then C and so on.
something would be
input
2
A
B
out put
1 A
1 B
0 C
0 D
0 E
0 F
Var e,f,g,h,i,j,u:integer; c:char; begin clrscr; e:=0; f:=0; g:=0; h:=0; i:=0; j:=0; u:=0; readln(a); for d := 1 to a do readln(c); case c of 'a': e:=e+1; 'b': f:=f+1; 'c': g:=g+1; 'd': h:=h+1; 'e':i:=i+1; 'f':j:=j+1 else u:=u+1; end; writeln(e); writeln(f); writeln(g); writeln(h); writeln(i); writeln(j); writeln(u); readln; end.And i have also another problem too, i saw the prime topic and i still don't get the codes, hwo would i fine the prime ?
If you guys can help me, i will be really thankful
Edited by WingedPanther, 25 December 2008 - 02:42 PM.
add code tags (the # button)


Sign In
Create Account

Back to top









