Problem B: 小数计算——结构体

来源:互联网 发布:网页过滤软件 编辑:程序博客网 时间:2024/06/01 08:12

这里写图片描述

#include <stdio.h>#include <stdlib.h>struct xiaoshu{    int head,tail;    char point;};void add(struct xiaoshu a,struct xiaoshu b){    printf("%d.%d",a.head+b.head,a.tail+b.tail);}int main(){    struct xiaoshu a,b;    void add(struct xiaoshu,struct xiaoshu);    scanf("%d%c%d",&a.head,&a.point,&a.tail);    scanf("%d%c%d",&b.head,&b.point,&b.tail);    add(a,b);    return 0;}
0 0
原创粉丝点击