首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看全站
Program ex1007
implicit none

integer,pointer::p(:)
integer,target::a(10)=(/10,24,33,42,54,8,90,3,4,23/)
interface
    function getmin(p)
    integer,pointer::p(:)
    integer,pointer::getmin
    end function
end interface

......................
阅读全部 | jude1990 贴于 2012年8月25日 14:13     hide bbsi
Program ex1004
implicit none

integer,pointer::a(:)
integer,target::b(5)=(/1,2,3,4,5/)
a=>b
write(*,*)a
a=>b(1:3)
write(*,*)a
a=>b(1:5:2)
write(*,*)a

......................
阅读全部 | jude1990 贴于 2012年8月25日 11:14     hide bbsi
Program ex1001
implicit none
character(len=20)::string

integer,target ::a=1
integer,pointer::p
p=>a
write(*,*)p
a=2
write(*,*)p
p=3
write(*,*)a
......................
阅读全部 | jude1990 贴于 2012年8月25日 10:32     hide bbsi
Program ex0901
implicit none
open (unit=10,file='Hello.txt')
write(10,*)"Hello"
stop
end
阅读全部 | jude1990 贴于 2012年8月25日 10:10     hide bbsi
#include <stdio.h>
int main(void)
{
    unsigned int original = 0xABC;
    unsigned int result = 0;
    unsigned int mask = 0xF; /* Righmost four bits */

    printf("\n original = %X", original);

    /* Insert first digit in result */
    result |= original&mask;    /* Put right 4 bits from original in result */

......................
阅读全部 | format_yang 贴于 2012年8月24日 22:55     hide bbsi
1/ 比较函数

#include <stdio.h>

compare(int a,int b)
{
    return a>b?a:b;
}

main()
{
    int a,b,c;
......................
阅读全部 | qiangguo1992 贴于 2012年8月24日 11:10     hide bbsi
Program ex0821
implicit none
    real,external ::func
    real,intrinsic::sin
    
    call ExecFunc(func)
    call ExecFunc(sin)
stop
end

subroutine ExecFunc(f)
    implicit none
......................
阅读全部 | jude1990 贴于 2012年8月23日 23:36     hide bbsi
Program ex0807
implicit none
    real::a=1,b=2
    real,external::add
    write(*,*)add(a,b)
stop
end


function add(a,b)
    implicit none
    real:: a,b
......................
阅读全部 | jude1990 贴于 2012年8月23日 17:46     hide bbsi
Program ex0804
implicit none

integer:: a=1,b=2
call add(1,2)

stop
end


subroutine add(first,second)
    implicit none
......................
阅读全部 | jude1990 贴于 2012年8月23日 17:11     hide bbsi
Program ex0801
implicit none

call message()
call message()

stop
end

subroutine message()
implicit none
write(*,*)"Hello."
......................
阅读全部 | jude1990 贴于 2012年8月23日 16:55     hide bbsi
上一页 289 290 291 292 293 294 295 296 297 298 下一页