Chinaunix首页 | 论坛 | 博客
  • 博客访问: 426817
  • 博文数量: 103
  • 博客积分: 5010
  • 博客等级: 大校
  • 技术积分: 971
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-11 17:22
文章分类
文章存档

2008年(77)

2007年(26)

我的朋友

分类: C/C++

2008-03-13 14:02:54

在windows平台下:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
    int            n, i;
    __int64     res;
    scanf("%d", &n);
    while(n){
            res = 1;
            for(i = 2; i <= n; i++){
                res = res * i;
            }
            break;
    }
    //printf("sizeof long int = %d bytes\n", sizeof(res));

    printf("result = %I64d\n", res);
    exit(0);
}

在linux平台下:
    <<< ... >>>

    printf("a = %Ld\n", a); /* for GNU */

    printf("a = %lld\n", a); /* for GNU another way */
 
    <<< ... >>>

阅读(1589) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~