标题:各位看看这程序出了什么问题。
取消只看楼主
x1443449347
Rank: 1
等 级:新手上路
帖 子:3
专家分:4
注 册:2014-11-12
结帖率:0
已结贴  问题点数:10 回复次数:0 
各位看看这程序出了什么问题。
#include<stdio.h>
void plus(float);
void minus(float);


int main(void)
{
  float p=0,a;
  int e;
  char c;
  
  printf("please input minuend p:\40");
  scanf("\40%f", &p);
  printf("please input'+'||'-':  ");
  scanf("%c", &c);
  e = c;
  
  
  if(43==e)
   plus(p);
  if(45==e)
   minus(p);
  return 0;
}

void plus(float p )
{
  float e,a;
  printf("please input minuend e:\40");
  scanf("\40%f", &e);
  printf("\40\40\40\40%-.1f\n", p);
  printf("\40\40+\40%-.1f\n", e);
  printf(".........\n");
  printf("\40\40\40%-.1f\n", a=(p+e));
  printf("please go on\n");
}
void minus(float p)
{
  float e,a;
  printf("please input minuend e:\40");
  scanf("\40%f", &e);
  printf("\40\40\40\40%-.1f\n", p);
  printf("\40\40-\40%-.1f\n", e);
  printf(".........\n");
  printf("\40\40\40%-.1f\n", a=(p-e));
  printf("please go on\n");
  
}
搜索更多相关主题的帖子: void float printf please scanf 
2017-11-16 18:56



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




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

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