| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 769 人关注过本帖
标题:各位看看这程序出了什么问题。
只看楼主 加入收藏
x1443449347
Rank: 1
等 级:新手上路
帖 子:3
专家分:4
注 册:2014-11-12
结帖率:0
收藏
已结贴  问题点数:10 回复次数:2 
各位看看这程序出了什么问题。
#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
吹水佬
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:451
帖 子:10541
专家分:42927
注 册:2014-5-20
收藏
得分:10 
回复 楼主 x1443449347
出了什么问题?
2017-11-16 19:58
吹水佬
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:451
帖 子:10541
专家分:42927
注 册:2014-5-20
收藏
得分:0 
//scanf("%c", &c);
scanf("\40%c", &c);
2017-11-16 22:25
快速回复:各位看看这程序出了什么问题。
数据加载中...
 
   



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

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