有数字1,2,3,4,5,6,问能组成多少个互不相同且无重复数字的三位数?并输出它们。
#include<iostream>
using namespace std;
int main()
{
int a, b, c;
int i = 0;
for (a = 1;a <=6;a++)
{
for (b = 1;b <= 6;b++)
{
for (c = 1;c <= 6;c++)
{
if (a == b || a == c || b == c)continue;
i++;
}
}
}
cout <<"一共能构成" << i <<"个互不重复的三位数" << endl;
cout << a << b << c << " ";
return 0;
}
我运行出来是这个样的是为什么啊