标题:程序运行到一般停止,求解。
只看楼主
love24114
Rank: 5Rank: 5
等 级:职业侠客
威 望:1
帖 子:223
专家分:399
注 册:2011-7-11
结帖率:81.48%
 问题点数:0 回复次数:2 
程序运行到一般停止,求解。
#include<stdio.h>
//问题已经解决
struct data{
    float amount;
    char fname;//char fname[30]
    char lname;//char lname[30]
}rec;

int main(void)
{
    printf("Enter the donor's first and last names.\n");
    printf("separaed by a space: ");
    scanf("%s %s",rec.fname,rec.lname);
    printf("\nEnter the donation amount");
    scanf("%f",&rec.amount);
    printf("\nDonor %s %s gave %f",rec.fname,rec.lname,rec.amount);
    return 0;
}

[ 本帖最后由 love24114 于 2011-7-14 19:40 编辑 ]
搜索更多相关主题的帖子: include return amount Enter 
2011-07-14 19:32
YangJ0720
Rank: 2
来 自:广西柳州市融安县
等 级:论坛游民
帖 子:17
专家分:18
注 册:2011-5-29
得分:0 
#include <stdio.h>//问题已经解决
#include <stdlib.h>
struct data//定义结构体data
{
     float amount;
     char fname[30];
     char lname[30];
}rec;
int main()
{
     printf("Enter the donor's first and last names.\n");
     printf("separaed by a space: ");
     scanf("%s %s",rec.fname,rec.lname);
     printf("\nEnter the donation amount");
     scanf("%f",&rec.amount);
     printf("\nDonor %s %s gave %f",rec.fname,rec.lname,rec.amount);
     system("pause");
}
2011-07-14 20:27
YangJ0720
Rank: 2
来 自:广西柳州市融安县
等 级:论坛游民
帖 子:17
专家分:18
注 册:2011-5-29
得分:0 
#include <stdio.h>//问题已经解决
#include <stdlib.h>
struct data//定义结构体data
{
     float amount;
     char fname[30];
     char lname[30];
}rec;
int main()
{
     printf("Enter the donor's first and last names.\n");
     printf("separaed by a space: ");
     scanf("%s %s",rec.fname,rec.lname);
     printf("\nEnter the donation amount");
     scanf("%f",&rec.amount);
     printf("\nDonor %s %s gave %f",rec.fname,rec.lname,rec.amount);
     system("pause");
}
2011-07-14 20:27



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




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

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