#include<stdio.h>
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~输入函数*/
int suru()
{
int a;
do
{
scanf(" %d",&a);
if(a<0||a>9)
printf("您输入字符超出范围,请重新输入:\n");
}
while(a<0||a>9);
return a;
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~运算函数*/
void yunsuan(int a[4])
{
int i,j,k,z,m=1;
楼上的代码好眼熟..呵呵
----------------解决方案--------------------------------------------------------
# include<iostream.h>
void main()
{
int a,b,c,d;
for(a=1;a<=4;a++){
for(b=1;b<=4;b++){
if(b==a)continue;
for(c=1;c<=4;c++){
if(c==a||c==b)continue;
for(d=1;d<=4;d++){
if(d==a||d==b||d==c)continue;
cout<<a<<b<<c<<d<<endl;
}
}
}
----------------解决方案--------------------------------------------------------
TO 7#
the Code in the book is
<< Fundamentals of data structures in C >>
----------------解决方案--------------------------------------------------------