±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 1596  |  »Ø¸´: 10
µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû

kathy2008

ľ³æ (ÕýʽдÊÖ)

[½»Á÷] ¡¾ÇóÖú¡¿Çë¸ÄÕý´íÎó ÒÑÓÐ7È˲ÎÓë

±¾ÈËÔÚÔËÐÐÒ»³ÌÐò£¬ÄÚÓÐÒ»¶Î³ÌÐòÈçÏ£º
program ex1009
use func
implicit none
type(person), target :: p(5) = (/ person("³Âͬѧ", 180.0, 75.0),
                                    person("»ÆÍ¬Ñ§", 170.0, 65.0),
                                                                person("Áõͬѧ", 175.0, 80.0),
                                                                person("²Ìͬѧ", 182.0, 78.0),
                                                                person("Ðíͬѧ", 178.0, 70.0) /)
         type(pperson) :: pt(5)

ÔËÐк󣬱¨´íÈçÏ£º
C:\Program Files\Microsoft Visual Studio\MyProjects\chapter 10\9.for(40) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( ...
   type(person), target :: p(5) = (/ person('³Âͬѧ', 180.0, 75.0),
---------------------------------------------------------------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\chapter 10\9.for(41) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( ...
                                    person('»ÆÍ¬Ñ§', 170.0, 65.0),
-------------------------------------------------------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\chapter 10\9.for(42) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( ...
               person("Áõͬѧ", 175.0, 80.0),
-----------------------------------------------------------------------------------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\chapter 10\9.for(43) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( ...
               person("²Ìͬѧ", 182.0, 78.0),

ÇëÎʸßÊÖÈçºÎ¸ÄÕý¡£Ð»Ð»¡£
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

±ÇÌéÅ£

½ð³æ (³õÈëÎÄ̳)

²»ºÃÒâ˼£¬·¢´íÁË

¡ï
Сľ³æ(½ð±Ò+0.5):¸ø¸öºì°ü£¬Ð»Ð»»ØÌû½»Á÷
type(person), target :: p(5) = (/ person("³Âͬѧ", 180.0, 75.0), &
                                    person("»ÆÍ¬Ñ§", 170.0, 65.0), &
                                      person("Áõͬѧ", 175.0, 80.0), &
                                        person("²Ìͬѧ", 182.0, 78.0), &
                                        person("Ðíͬѧ", 178.0, 70.0) /)
±¾ÎÄÀ´×Ô: Сľ³æÂÛ̳ http://muchong.com/bbs/viewthread.php?tid=2348595&pid=2148561&page=1#pid2148561
×ÝÀË´ó»¯ÖУ¬²»Ï²Ò಻¾å¡£Ó¦¾¡±ãÐ뾡£¬ÎÞ¸´¶À¶àÂÇ
9Â¥2010-09-03 08:24:18
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 11 ¸ö»Ø´ð

yfx2003

½ð³æ (ÖøÃûдÊÖ)

¡ï
Сľ³æ(½ð±Ò+0.5):¸ø¸öºì°ü£¬Ð»Ð»»ØÌû½»Á÷
²»ÖªµÀÕâ¸ö //¸ÉÂï
Signyournicknamehere
3Â¥2010-08-31 08:45:26
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

kathy2008

ľ³æ (ÕýʽдÊÖ)

Èç¹û×Ô¼º»á¸ÄÕý´íÎ󣬾Ͳ»»á·¢µ½ÕâÂÛ̳ÉÏÀ´ÁË¡£ÎÒÊÇÖ¸ÔËÐÐÅí¹úÂÖFortran95 µÄÔ´³ÌÐòʱ±¨´íµÄ¡£ÎļþÃûΪex0921.for.ÒòΪÓöµ½ºÃ¼¸¸öÀàËÆµÄÎÊÌ⣬ËùÒÔÇë¸ßÊÖÖ¸µã¡£³ÌÐòÈçÏ£º
        module typedef
          type student
                integer :: Chinese,English,Math,Natural,Social
                integer :: total
          end type
        end module

        program ex0921
          use typedef
          implicit none
          integer,parameter :: fileid=10
          integer,parameter :: students=20
          character(len=80) :: tempstr
          type(student) :: s(students)
          type(student) :: total
          integer i,num,error

          open(fileid,file="grades.txt",status="old",iostat=error)
          if(error/=0) then
                write(*,*) "open grades.txt fail."
          end if

          read(fileid,"(A80)" tempstr
          total=student(0,0,0,0,0)

          do i=1,students
            read(fileid,*) num,s(i)%Chinese,s(i)%English,s(i)%Math,
                           s(i)%Natural,s(i)%Social
                s(i)%total=s(i)%Chinese + s(i)%English + s(i)%Math
                            + s(i)%Natural + s(i)%Social
                total%Chinese = total%Chinese + s(i)%Chinese
                total%English = total%English + s(i)%English
                total%Math    = total%Math + s(i)%Math
                total%Natural = total%Natural + s(i)%Natural
                total%Social  = total%Social + s(i)%Social
                total%Total   = total%Total + s(i)%Total
          end do
       
          write(*,"(7A7)" "×ùºÅ","ÖÐÎÄ","Ó¢ÎÄ","Êýѧ","×ÔÈ»","Éç»á","×Ü·Ö"
         do i=1,students
           write(*,"(7I7)" i, s(i)
         end do

         write(*,"(A7,6F7.1)" "ƽ¾ù"
                real(total%Chinese) real(students),
                real(total%English) real(students),
                real(total%Math)    real(students),
                real(total%Natural) real(students),
                real(total%Social)  real(students),
                real(total%Total)   real(students)

         stop
        end program
4Â¥2010-08-31 09:53:37
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

yalefield

½ð³æ (ÎÄ̳¾«Ó¢)

ÀϺºÒ»Ã¶

¡ï ¡ï
Сľ³æ(½ð±Ò+0.5):¸ø¸öºì°ü£¬Ð»Ð»»ØÌû½»Á÷
ÓàÔó³É(½ð±Ò+1):ÐÁ¿àÁË£¡ 2010-08-31 15:45:12
ÒýÓûØÌû:
C:\Program Files\Microsoft Visual Studio\MyProjects\chapter 10\9.for(40) : Error:
Syntax error, found END-OF-STATEMENT when expecting one of: ( ...
   type(person), target :: p(5) = (/ person('³Âͬѧ', 180.0, 75.0),

Óë³ÌÐò¹ØÏµ²»´ó£¬ÓëÄúµÄÓ¢Óïˮƽ¹ØÏµºÜ´ó¡£

Syntax error
¡°¾ä·¨´íÎ󣺡±

Fortran£¬ÄÜÕâô»»ÐÐÂð£¿
°³±Õ¹Ø¶àÄê£¬Õæ²»ÖªµÀÊÀʱäǨ¡£
5Â¥2010-08-31 10:06:47
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 0805Çóµ÷¼Á +5 ÊÇË®·Ö 2026-03-31 5/250 2026-03-31 20:48 by yuq
[¿¼ÑÐ] 311£¨085601£©Çóµ÷¼Á +9 liziyeyeye 2026-03-28 10/500 2026-03-31 20:19 by Jaylen.
[¿¼ÑÐ] 080200רҵ277·Ö£¬Çó´ø×ߣ¡ +4 Æ¿×ÓPZ 2026-03-31 4/200 2026-03-31 20:16 by vgtyfty
[¿¼ÑÐ] 324·Ö 085600²ÄÁÏÓ뻯¹¤ +6 ´ô¶ìoor 2026-03-27 6/300 2026-03-31 19:03 by xixiangyue6220
[¿¼ÑÐ] ²ÄÁÏ¿ÆÑ§Ó빤³Ì339Çóµ÷¼Á +3 hyz0119 2026-03-31 3/150 2026-03-31 18:31 by 1939136013¹·×³
[¿¼ÑÐ] »·¾³¹¤³Ì297·ÖÇóµ÷¼ÁÒ»Ö¾Ô¸º¼¸ßÔº +6 GENJIOW 2026-03-31 6/300 2026-03-31 18:01 by 544594351
[¿¼ÑÐ] ѧ˶274Çóµ÷¼Á +17 LiÀîÓã 2026-03-26 17/850 2026-03-31 15:19 by ¿Í¶ûÃÀµÂ
[¿¼ÑÐ] ÍÁľ304Çóµ÷¼Á +4 ÍÃͻͻͻ£¬ 2026-03-31 5/250 2026-03-31 11:29 by ±±·çÖ®Éñ.
[¿¼ÑÐ] һ־ԸʳƷ¿ÆÑ§Ó빤³Ì083200Çóµ÷¼Á +4 XQTJZ 2026-03-30 4/200 2026-03-31 04:10 by fmesaito
[¿¼ÑÐ] ʳƷ¹¤³Ìר˶һ־ԸÖк£Ñó309Çóµ÷¼Á +5 СÕÅzxyÕÅ 2026-03-26 10/500 2026-03-31 00:29 by jp9609
[¿¼ÑÐ] 11408×Ü·Ö309£¬Ò»Ö¾Ô¸¶«ÄÏ´óѧÇóµ÷¼Á£¬²»Ìôרҵ +5 Ì츳´øµ½THU 2026-03-29 6/300 2026-03-30 20:49 by dick_runner
[¿¼ÑÐ] 292Çóµ÷¼Á +13 ÊÇåû×ÓÒ²ÊÇÑÐ×Ó 2026-03-30 13/650 2026-03-30 18:01 by СÐì0109
[¿¼ÑÐ] 2026Ä껪ÄÏʦ·¶´óѧ»¶Ó­»¯Ñ§£¬»¯¹¤£¬ÉúÎÉúÒ½¹¤µÈרҵÓÅÐãѧ×Ó¼ÓÈ룡 +3 llss0711 2026-03-28 6/300 2026-03-29 10:26 by llss0711
[¿¼ÑÐ] µ÷¼Á¿¼ÑÐ +3 Íõ½ÜÒ» 2026-03-29 3/150 2026-03-29 08:09 by fmesaito
[¿¼ÑÐ] 321Çóµ÷¼Á +7 è±Óñ~~ 2026-03-25 8/400 2026-03-29 06:41 by 544594351
[¿¼ÑÐ] 11408Èí¼þ¹¤³ÌÇóµ÷¼Á +3 Qiuѧing 2026-03-28 3/150 2026-03-28 21:50 by zhq0425
[¿¼ÑÐ] 316Çóµ÷¼Á +7 ½­´Ç666 2026-03-26 7/350 2026-03-28 21:28 by sanrepian
[¿¼ÑÐ] 394Çóµ÷¼Á +3 ºÃʶàÄ¥¾²ºò¼ÑÒ 2026-03-26 5/250 2026-03-28 14:24 by ÌÆãå¶ù
[¿¼ÑÐ] µ÷¼ÁÍÆ¼ö +5 Ç徯714 2026-03-26 6/300 2026-03-27 11:12 by ²»³Ôô~µÄ؈
[¿¼ÑÐ] ¿¼ÑÐÒ»Ö¾Ô¸ËÕÖÝ´óѧ³õʼ315£¨Ó¢Ò»£©Çóµ÷¼Á +3 sbdksD 2026-03-24 4/200 2026-03-25 18:16 by xcjcqu
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û