一个简单的C语言问题,输入数值之后就关闭了,我加pause了呀

来源:百度知道 编辑:UC知道 时间:2024/04/30 00:32:53
#include<stdio.h>
#include <stdlib.h>
int main()
{int im,h,m;
printf("Please enter the time: ");
scanf("%d,&im");
printf("time is %d min\n",im);
h=im/60;m=im%60;
printf("%3d min is %3d hour %3d min\n",im,h,m);
system("pause");

}

程序有误:更改如下:
#include<stdio.h>
#include <stdlib.h>
int main()
{int im,h,m;
printf("Please enter the time: ");
scanf("%d",&im);////////////////////////
printf("time is %d min\n",im);
h=im/60;m=im%60;
printf("%3d min is %3d hour %3d min\n",im,h,m);
system("pause");

}

system("pause");

换成

getch();

就可以了!

输入语句的格式写错了,
scanf("%d",&im);

你的程序能运行起来吗怎么我看scanf那行就错啦