function [flops] = hw7afn(n,A)

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

end
