c++ 数制转换 只能正确编译一次 求解释。加急!
#include<iostream>
using namespace std;
int main()
{
int x;
int n;
int k=0;
int b;
int h[100];
cout<<"Please input one number:";
cin>>n;
x=n;
while(x>0)
{
b=x;
x=x/16;
h[k]=b%16;
k=k+1;
}
if(x==0)
k--;
else
h[k]=x;
cout<<"转换为十六进制"<<n<<"是:";
while(k>=0)
{
char ch;
if(h[k]>=0&&h[k]<=9)
ch=h[k]+'0';
else
ch=h[k]-10+'A';
cout<<ch;
k--;
}
return 0;
}
第一次编译运行都没问题,结果也正确,但第二次就会出现错误,如下:
fatal error C1083: Cannot open compiler generated file: 'Debug/s.obj': Permission denied
求指教;