function [flops] = hw8afn(n,A)

   flops = 0;
   for i = 1:n-1
      for j = i+1:n
         A(j,i) = A(j,i)/A(i,i);
         flops = flops+1;
         for k = i+1:n
            A(j,k) = A(j,k)-A(j,i)*A(i,k);   
            flops = flops+2;
         end
      end
   end

end
