#include<iostream>

#include<algorithm>

using namespace std;

int main(){

int a[4],i;

   for(i=0;i<4;i++){

      cin>>a[i];

   }

    do{

    cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl;

    }while(next_permutation(a,a+2));   //自动实现a[0]到a[2]的全排列

    int A[3]={a[0],a[1],a[3]};

    do{

    cout<<A[0]<<" "<<A[1]<<" "<<A[2]<<endl;

    }while(next_permutation(A,A+2));  

    int B[3]={a[0],a[2],a[3]};

    do{

    cout<<B[0]<<" "<<B[1]<<" "<<B[2]<<endl;

    }while(next_permutation(B,B+2);

    do{

    cout<<a[1]<<" "<<a[2]<<" "<<a[3]<<endl;

    }while(next_permutation(a+1,a+3));

return 0;

}


 

0.0分

0 人评分

  评论区

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    int a,b;
    int c;
    scanf("%d", &a);
    for (int i = 0;i < a; i++){
        scanf("%d",  &b);
        c = c+b;
    }
    printf("%d\n",c/a);
	return 0;
}
2018-11-29 18:38:35
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    int a,b;
    scanf("%d%d", &a, &b);
    printf("%d\n",a+b);
	printf("Hello,C world of AnycodeX!");
	return 0;
}
2018-11-29 16:20:21
厉害
2018-11-29 16:04:38
  • «
  • 1
  • »