Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
InfoPedia Forum Index » Pascal

Post new topic   Reply to topic
Cod--Rasturnatul unui numar
View previous topic :: View next topic  
Author Message
InfoPedia
Fondator
Fondator


Joined: 02 Feb 2008
Posts: 6

PostPosted: 03/02/2008 15:12    Post subject: Cod--Rasturnatul unui numar Reply with quote

Acest program va gasii toate numerele de 2 cifre care au rasturnatul patratului egal cu patratul numarului rasturnat

Code:
program rasturnat;
var a,b,c,d:natural;
n:natural;
begin
       c:=0;
       repeat
              c:=c*10+a%10;
              a:=a/10;
              until a=0;
       n:=9;
       repeat
              n:=n+1;
              a:=n*n;
              repeat
                     b:=b*10+a%10;
                     a:=a/10;
              until a=0;
              m:=n;
              c:=0;
              repeat
                     c:=c*10+m%10
              until n=0;
              d:=c*c;
              if c=d then write n
       until n=99
       readln;
end.


Copyright © Astaroth si http://forum.evomedia.org


Last edited by InfoPedia on 03/02/2008 20:12; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    InfoPedia Forum Index » Pascal All times are GMT + 3 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional

Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro