#define _CRT_SECURE_NO_WARNINGS
#include
#include
int main()
{
unsigned int num = 0;
scanf("%u",&num);
if (num <= 10)
{
return 0;
}
unsigned int wei = 0;
unsigned int a = num;
while (a)
{
wei++;
a /= 10;
}
unsigned int n = wei - 1;
unsigned int last = 1;
while (n)
{
last *= 10;
n--;
}
unsigned int lastres = 0;
lastres = (num / last)*last;
unsigned int b = 0;
b=num - lastres;
printf("\n%d", b);
system("pause");
return 1;
}
为什么提交之后华为系统返回格式错误,我用VS2015编译没事呀!
为什么提交之后会出现格式错误,我用vs2015编译没事呀!求助!
这变量名 谁看懂了。。。而且没题目啊
为什么return 1
那你得考虑华为用什么编译的。
你#include后面真的没东西了吗?!
感觉应该是system("pause");
的问题,华为面试是采用机器判题的吧,你让它一直pause在那,程序当然无法返回正确的结果了。
而且,按照惯例,一般程序正常退出返回的状态码是0.