#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; }
#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; }
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:607 |
字符串输入输出函数 (Java代码)浏览:1498 |
简单的a+b (C语言代码)浏览:878 |
C语言程序设计教程(第三版)课后习题9.2 (C语言代码)浏览:573 |
1071题解浏览:584 |
简单的a+b (C语言代码)浏览:1024 |
C二级辅导-进制转换 (C语言代码)浏览:750 |
复数求和 (C语言代码)浏览:994 |
字符串比较 (C语言代码)浏览:770 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:765 |