我是初学者,我所做的就是练习在Codecademy中编写代码.在谷歌广泛搜索如何运行.js文件之后,我什么都没看到.我假设我问的是错误的问题,我确信这很简单,但我找不到任何东西.
我以前编译过其他程序,但由于某种原因,我不能再工作了.我有一个mac这是我的代码.它的目的是取三个数字并找到平均值.
#include <stdio.h>
int main(){
int first;
int second;
int third;
float average=0.0;
printf ("This program will find the average of 3 numbers.\n");
delay(1000);
printf ("Type the first number.\n");
scanf ("%d", &first);
printf ("Type the second number.\n");
scanf ("%d", &second);
printf ("Type the third number.\n");
scanf ("%d", &third);
average = (first+second+third)/2.0;
printf ("The average of %d, %d, and %d is %.3f\n", first, second, third, average);
return (0);
}
Run Code Online (Sandbox Code Playgroud)
这些是我采取的步骤.我把average.c和average.h放在桌面上.我打开终端并输入
cd Desktop
gcc /Users/reneelion/Desktop/average.c average
Run Code Online (Sandbox Code Playgroud)
然后它说:
average: No such file or …Run Code Online (Sandbox Code Playgroud) 我是HTML的初学者.如何使用JavaScript点击隐藏自己的按钮?这是我已经存在的代码,缺少一条线.
<!DOCTYPE>
<html>
<body>
<button type="button" onclick="delete()" = ;>Hello</button>
<script>
var delete = function(){
//hide button
}
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)