标题:新手使用win-tc时,遇到一个问题,求解???
取消只看楼主
冯志强采桑子
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2013-4-11
结帖率:50%
已结贴  问题点数:20 回复次数:2 
新手使用win-tc时,遇到一个问题,求解???
/* Program 2.8 calculations on a table */
#include <stdio.h>

int main(void)
{

  float radius = 0.0f; /*The radius of the table */
  float diameter = 0.0f; /*The diameter of the table */
  float circumference = 0.0f;   /*The circumference of the table */
  float area = 0.0f; /*The area of a circle */
  float Pi = 3.1415926f;

  printf("Input the diameter of the table :6");
  scanf("%f",&diameter); /*Read the diameter from the keyboard */
  radius = diameter/2.0f; /*Calculate the radius */
  circumference = 2.0f*Pi*radius; /*Calculate the circumference */
  area = Pi*radius*radius; /*Calculate the area */
  printf("\nThe circumference is %,2f",circumference);
  printf("\nThe area is %.2f\n",area );
  getch();
  return 0;
  }

我在编译器里面输入如上:
书上说的是应该输出的如下:
Input the diameter of the table:6

The circumference is 18.85
The area is 28.27


但是为什么我出来的只是:
Input the diameter of the table:

初学者小弟在此谢谢大家了,求解
搜索更多相关主题的帖子: void keyboard include 
2013-04-11 21:31
冯志强采桑子
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2013-4-11
得分:0 
回复 3楼 我国的驾
我按照书上的 我也不知道 那个6怎么出来的 而且后面的函数都显示不了 求解
2013-04-14 22:06
冯志强采桑子
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2013-4-11
得分:0 
回复 楼主 冯志强采桑子
我是对书自学 这个问题真心求解啊
2013-04-14 22:07



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




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

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