标题:求各位帮忙调试一下
取消只看楼主
li362490567
Rank: 1
等 级:新手上路
帖 子:89
专家分:8
注 册:2015-7-9
结帖率:0
 问题点数:0 回复次数:0 
求各位帮忙调试一下
#include<stdio.h>
#include<string.h>
#define DENSITY 62.4
int main(void)
{
    float weight, volume;
    int size, letters;
    char name[40];
    printf("Hi! What's your first name?\n");
    scanf_s("%s", name);
    printf("%s, what's your weight in pounds?\n", name);
    scanf_s("%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后为何显示一串“烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫”乱码??
搜索更多相关主题的帖子: volume letters include 
2015-07-10 11:33



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




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

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