Vocaloid - Gumi

Music Player

Kamis, 16 April 2015

matrix rotate 90 derajat

var a,b,i,j,kaya,miskin:integer;
 
    x:array[1..100,1..100]of integer;
 
begin
 
read(a);
 
read(b);
 
 for i:=1 to a do begin
 
  for j:=1 to b do begin
 
   read (x[i,j]);
 
  end;
 
 end;       
     
                
                             
kaya:=a;     
                 
a:=b   ;     
              
b:=kaya;       
             
 for i:=1 to a do    
      
  for j:=b downto 1 do      
   if j = 1 then              
    writeln (x[j,i])    
    
   else write (x[j,i],' ');  
 
end.                     

Tidak ada komentar:

Posting Komentar