下载此文档

Fortran程序设计实验报告.doc


文档分类:IT计算机 | 页数:约28页 举报非法文档有奖
1/28
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/28 下载此文档
文档列表 文档介绍
河北大学工商学院fortran程序设计实验报告
年级 2010级学号姓名王丽丽成绩
专业土木工程实验地点 B3-216 指导教师袁满
实验项目输入输出和声明语句实验日期 2012-3-2
实验目的:练****fortran语言中的输入输出和声明语句的使用
实验要求:阅读书上例题并调试运行
实验结果及分析
program e41
implicit none
integer a
real b
complex c
logical d
character*(20) e
a=10
b=
c=(1,2)
d=.true.
e="fortran"
write(*,100) a 运行结果:
100 format(1x,i5)
write(*,200) b
200 format(1x,)
write(*,300) c
300 format(1x,,)
write(*,400) d
400 format(1x,l3)
write(*,500) e
500 format(1x,a10)
End
河北大学工商学院fortran程序设计实验报告
年级 2010级学号姓名王丽丽成绩
专业土木工程实验地点 B3-216 指导教师袁满
实验项目输入输出和声明语句实验日期 2012-3-9
实验目的:练****fortran语言中的输入输出和声明语句的使用
实验要求:练****使用输入输出和声明语句
实验结果及分析
(1)program t0402 运行结果:
real r,mj,zc
write(*,*)"请输入圆的半径"
read(*,*) r
pai=
mj=r*r*pai
zc=2*pai*r
write(*,*) "圆的面积是:",mj
write(*,*) "圆的周长是:",zc
stop
end program t0402
end program t0403
(2)program t0401 运行结果:
real ra,rb
integer a,b
a=2
b=3
ra=
rb=
write(*,*) b/a 整型变量只保留数值的整数位,小数部分舍去。
write(*,*) rb/ra
stop
end
(3)program t0405 运行结果:
implicit none
type distance
real cm
real m
real inch
end type distance
type(distance) a
write(*,*)"请输入公尺数:"
read(*,*),a%m
a%cm=a%m*100
a%inch=a%cm/
write(*,*)"米数:",a%m
write(*,*)"厘米数:",a%cm
write(*,*)"英寸数:",a%inch
stop
end program t0405
河北大学工商学院Fortran程序设计实验报告
年级 2010级学号姓名王丽丽成绩
专业土木工程实验地点 B3-216 指导教师袁满
实验项目练****Visual Fortran的使用实验日期 2012-3-16
实验目的:练****fortran中选择、判断、分支语句的写法。
实验要求:阅读例题并调试运行
实验结果及分析
program e51
implicit none
integer score
character grade
write(*,*) "Score:" 运行结果:
read(*,*) score
if ( score>=90 .and. score<=100 ) then
grade='A'
else if ( score>=80 .and. score<90 ) then
grade='B'
else if ( score>=70 .and. score<80 ) then
grade='C'
else if ( score>=60 .and. score<70 ) then
grade='D'
else if ( score>=0 .and. score<60 ) then
grade='E'
else
grade='?'
end if
write(*,"('Grade:',A1)") grade
stop
end
河北大学工商学院Fortran程序设计实验报告
年级 2010级学号姓名王丽丽成绩
专业土木工程实验地点 B3-216 指导教师袁满
实验

Fortran程序设计实验报告 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数28
  • 收藏数0 收藏
  • 顶次数0
  • 上传人glfsnxh
  • 文件大小558 KB
  • 时间2018-02-21