|
运行后发现 第一部分求e的后10000位可以得到结果
第二部分就卡住了
我觉得可能是定义或者mod的问题,因为求的是10位数的质数,用tmp(10位数组)除数得到的余数不准确附了代码
求指明方向!!!!拜托了
[Fortran] 纯文本查看 复制代码 03 | Implicit Real * 8 ( A , C - H , O - S , U - Z ) |
04 | Integer , Parameter :: nk = 10000 |
05 | Dimension :: ns ( nk ) , na ( nk ) , nt ( nk ) , prime ( 20 ) |
06 | Integer :: i , j , b , it , l |
22 | nd = mod ( na ( i -1 ) , n ) * 10 + nt ( i ) |
33 | ns ( i -1 ) = ns ( i -1 ) + ns ( i ) / 10 |
34 | ns ( i ) = mod ( ns ( i ) , 10 ) |
40 | Write ( * , '(8x,77i1)' ) ( ns ( i ) , i = 2 , 77 ) |
41 | Write ( * , '(80i1)' ) ( ns ( i ) , i = 78 , nk ) |
45 | loop_utmost : Do i = 2 , nk - 10 |
48 | loop_tmp : Do j = i , i + 9 |
54 | loop_check : Do it = 2 , l |
55 | If ( mod ( tmp , real ( it ) ) == 0 ) Then |
73 | Print * , 'The ten digital primes in e:' |
74 | Write ( * , '(i5,f15.1)' ) ( prime ( i ) , i = 1 , b ) |
|
|