读书人

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

发布时间: 2012-03-14 12:01:12 作者: rapoo

在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> 

读书人网 >C++

热点推荐