问题描述
我在C上上课,我不是很好,所以我想问你,我如何解决问题:Id返回1退出状态,我一直在努力
I am taking a class on C, and I'm not very good at it , so I would like to ask you, how do I solve the problem: "Id returned 1 exit status", I have been struggling with it for quite a while, so I would really appreciate your help.
#include <stdio.h>
#include<conio.h>
#include<windows.h>
int main()
{
int P, N, NP=0;
printf("Introduzca en nombre del producto:\n");
scanf("%f", &N);
printf("Introduzca en precio del producto:\n");
scanf("%f", &P);
if (P <= 1500)
NP=P*1.11;
else
NP=P*1.08;
printf("El producto %d cuesta %d", NP, N);
getche();
return 0;
}
错误的完整列表为:
Permission denied
Id returned 1 exit status
推荐答案
它与代码没有任何关系。您的操作系统根本不允许在使用文件时对其进行修改,因此编译(实际上,链接 ld
是链接器)失败,因为编译器不能删除旧的可执行文件并放置一个新的。要解决这个问题,只需关闭运行该程序的所有现有进程即可。
It does not have anything to do with code. Your operating system simply does not allow to modify a file while it is in use, so the compilation (actually, linking, ld
is the linker) fails, because compiler can't remove the old executable and place a new one. To solve this, simply close all existing processes running that program.
如果没有效果,请检查您的可执行文件所在目录的权限, (一些系统允许程序在文件上放置锁,所以没有其他程序可以修改它)。
If that won't work, check your permissions for directory the executable is in, or look for any programs that are currently using it (some systems allow programs to place a lock on a file, so no other program can modify it).
这篇关于什么是“Permission denied” “Id返回1退出状态”意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!