主题:新手求助关于编程
这是我自己按图写的,但是怎样都现实有ERROR,但我又不知道怎样改,有没有大神可以帮忙一下,帮我改一下,或者教我一下啊,
PROGRAM car
IMPLICIT NONE
INTEGER::a ! variable of speed
INTEGER::b ! variable of speed zone
INTEGER::c ! variable of over speed
CHARACTER(2)::a1
WRITE(*, *)"please enter your speed of km/h, and limit of speed for zone"
READ(*, *)a, b
WRITE(*, *)"please enter your car type,light vihicle=L,ming rang truck=M, heavy vehiclees=H"
READ(*, *)a1
c=a-b
IF(al="L")THEN
IF(c<=10)THEN
WRITE(*, *)"demerit point is 4, fine of light vehicle is $105, ming rang trucks is $313, coach and heavy vehicles is $313 "
ELSE IF (c>10.AND.a<=20)THEN
WRITE(*, *)"demerit point is 4, fine of light vehicle is $417, ming rang trucks is $521, coach and heavy vehicles is $521"
ELSE IF (c>30.AND.a<=45)THEN
WRITE(*, *)"demerit point is 5, fine of light vehicle is $799, ming rang trucks is $799, coach and heavy vehicles is $1251"
ELSE IF (c>45)THEN
WRITE(*, *)"demerit point is 4, fine of light vehicle is $243, ming rang trucks is $417, coach and heavy vehicles is $417"
END IF
ELSE IF(al="M")THEN
IF(c<=10)then
WRITE(*, *)"demerit point is 4, fine of light vehicle is $105, ming rang trucks is $313, coach and heavy vehicles is $313 "
ELSE IF (c>10.AND.a<=20)THEN
WRITE(*, *)"demerit point is 4, fine of light vehicle is $417, ming rang trucks is $521, coach and heavy vehicles is $521"
ELSE IF (c>30.AND.a<=45)THEN
WRITE(*, *)"demerit point is 5, fine of light vehicle is $799, ming rang trucks is $799, coach and heavy vehicles is $1251"
ELSE IF (c>45)THEN
WRITE(*, *)"demerit point is 4, fine of light vehicle is $243, ming rang trucks is $417, coach and heavy vehicles is $417"
END IF
ELSE IF(a1="H")THEN
IF(c<=10)then
WRITE(*, *)"demerit point is 4, fine of light vehicle is $105, ming rang trucks is $313, coach and heavy vehicles is $313 "
ELSE IF (c>10.AND.a<=20)THEN
WRITE(*, *)"demerit point is 4, fine of light vehicle is $417, ming rang trucks is $521, coach and heavy vehicles is $521"
ELSE IF (c>30.AND.a<=45)THEN
WRITE(*, *)"demerit point is 5, fine of light vehicle is $799, ming rang trucks is $799, coach and heavy vehicles is $1251"
ELSE IF (c>45)THEN
WRITE(*, *)"demerit point is 4, fine of light vehicle is $243, ming rang trucks is $417, coach and heavy vehicles is $417"
END IF
END IF
END PROGRAM car
顺手问句,有什么办法判断输入的某个数字是否是素数,在FORTRAN这个语言