标题:书上的例子我打到VC6.0上运行不出来,是为什么啊?
取消只看楼主
阿郎来也
Rank: 1
等 级:新手上路
帖 子:16
专家分:6
注 册:2011-8-11
结帖率:100%
 问题点数:0 回复次数:1 
书上的例子我打到VC6.0上运行不出来,是为什么啊?
#include <stdio.h>
#include <string.h>
#define DENSITY 62.4
int main ()
{
    float weight,volume;
    int size,letters;
    char name[40];
    printf("Hi! what's your name?\n");
    scanf("%s",name);
    printf("%s, what's your weight in pounds?\n",name);
    scanf("%f",&weight);
    size = sizeof name;
    letters = strlen(name);
    volume =weight / DENSITY;
    printf("Well, %s, your volume is %2.2f cubic feet.\n ",name,volume);
    printf("Also,your first name has %d letters,\n",letters);
    printf("and we have %d bytes to store it in.\n",size);
    return 0;
}
搜索更多相关主题的帖子: name include letters volume 
2012-01-28 15:42
阿郎来也
Rank: 1
等 级:新手上路
帖 子:16
专家分:6
注 册:2011-8-11
得分:0 
谢谢大家了
2012-01-29 21:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-360073-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.043393 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved