! 2.10a.f90 ! $Id: 2.10a.f90 1.3 2024/12/07 04:14:49 s Exp $ ! program ex2_10a implicit none ! bp, Barrels produced : 生産量(バレル) ! gr, Gross revenue : 総収入 ! ni, Net income : 正味収益 ! op1, Option1 : 選択肢1 ! op2, Option2 : 選択肢2 ! da, Depletion allowance : 消耗控除 ! ti, Tax income : 課税対象収益 ! tax : 税金 ! ai, After-tax income : 税引き後収益 ! sumda : 全消耗控除 character(100) fmt1, fmt2 integer i, n real ai(100),bp(100),da(100),gr(100),ni(100),op1(100),op2(100),tax(100),ti(100) real sumda n = 5 bp(1:n) = (/ 80e3, 70e3, 50e3, 30e3, 10e3/) gr(1:n) = (/1600e3, 1400e3, 1000e3, 600e3, 200e3/) ni(1:n) = (/1200e3, 1000e3, 500e3, 200e3, 50e3/) op1(1:n) = min(gr(1:n) * 0.22, ni(1:n) * 0.5) op2(1:n) = bp(1:5) * 5 da(1:n) = max(op1(1:n), op2(1:n)) ti(1:n) = ni(1:n) - da(1:n) tax(1:n) = ti(1:n) * 0.45 ai(1:n) = ni(1:n) - tax(1:n) sumda = sum(da(1:n)) print *, '2.10a.f90' fmt1 = '(a3, 9a8)' print fmt1, 'y','bp','gr','ni','op1','op2','da','ti','tax','ai' call keisen(75) fmt2 = '(i3, 9i8)' do i = 1, n print fmt2, i,int(bp(i)),int(gr(i)),int(ni(i)), & int(op1(i)),int(op2(i)),int(da(i)),int(ti(i)),int(tax(i)),int(ai(i)) end do call keisen(75) print '(a43, i8)', 'sum of da=', int(sumda) stop contains subroutine keisen(n) implicit none integer i, n print *, ('-', i = 1, n) end subroutine keisen end program ex2_10a ! eof