首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

在dev cpp上编写的c程序 请指出异常

2012-03-14 
在dev cpp上编写的c程序 请指出错误这个程序只能运行第一行 输入 数字后 就一闪而过 什么都没有#includes

在dev cpp上编写的c程序 请指出错误
这个程序只能运行第一行 输入 数字后 就一闪而过 什么都没有
#include<stdio.h>
int main (void)
{
  int age ;
  double secs;
  printf("please enter your age :____\b\b\b\b");
  scanf("%c",&age);
  secs = age * 3.156e7;
  printf(" your age in years : %d in seconds:%e\n",age ,secs);
  getchar();
  return 0;
   
}

[解决办法]

C/C++ code
#include<stdio.h>int main (void){  int age ;  double secs;  printf("please enter your age :____\b\b\b\b");  scanf("%c",&age);  secs = age * 3.156e7;  printf(" your age in years : %d in seconds:%e\n",age ,secs);  getchar();  system("pause");  return 0;}
[解决办法]
C/C++ code
#include <stdlib.h> 

热点排行