|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
大佬们,在编写途中电脑关闭再打开后重新 vi test3.c 后他给我提示文件重复所以我就翻译了一下他给我的
代码于是我在终端输入vim -r test3.c 进去编译完后显示找不到文件:
这是我写的代码:
#include<stdio.h>
#include"sswbtr1.h"
int main()
{
int age,hr,hr_max,bpm;
printf("请输入您的年龄:");
scanf("%d",&age);
hr = getHeartRate();
hr_max = 220 - age; //最大心率测算
bpm = 150;
playSound(bpm);
if(hr >= hr_max)
{
printf("请立即停止跑步,否则会有生命危险!");
}
else if (hr >= hr_max * 0.85)
{
printf("请放慢脚步!");
bpm = bpm-20;
playSound(bpm);
}
else if (hr >= hr_max * 0.75)
{
printf("请加快节奏!");
bpm = bpm+20
playSound(bpm);
}
else
{
playSound(bpm);
}
return 0;
这是编译后显示的问题:
test3.c:2:20: error: sswbtr1.h: No such file or directory
test3.c: In function ‘main’:
test3.c:38: error: expected ‘;’ before ‘playSound’
本来就不能运行,所以不用管了
|
|