rookie又来了,还是c++问题

附上代码正文,问什么我输入了一个16进制的数后什么反应都没有,求解!!!

#include
#include
#include
using namespace std;
void main() {
char a[10];
cin >> a;
int i,j;
for (i = 0; i < 10; i++)
if ((a[i] >= 'A'&&a[i] <= 'Z') || (a[i] >= 'a'&&a[i] <= 'z'))
j = 1;
else
j = 0;
switch (j)
{
case 1:cout.setf(ios::hex);

{int a;
{int b = 0;
for (a = 0; a < 10; a++)
b = b + a;
cout << b << endl;
cout.unsetf(ios::hex);
break; }
}
default:
break; int c;
int d = 0;
for (c = 0; d < 10; c++)
d = d + c;
cout << d << endl;
break;
}
system("pause");
}

0
扫码支付0.1元 ×