无脑打印,没想到什么更好的解决办法。(文章先收藏了以后看看)
#include<bits/stdc++.h> using namespace std; int main(){ vector<int> num(4,0),temp; for(int i=0;i<4;i++){ cin >> num[i]; } temp = num; for(vector<int>::iterator it=temp.end()-1;it!=temp.begin()-1;it--){ temp.erase(it); printf("%d %d %d\n",temp[0],temp[1],temp[2]);//此处打印次序观察样例得到 printf("%d %d %d\n",temp[0],temp[2],temp[1]); printf("%d %d %d\n",temp[1],temp[0],temp[2]); printf("%d %d %d\n",temp[1],temp[2],temp[0]); printf("%d %d %d\n",temp[2],temp[0],temp[1]); printf("%d %d %d\n",temp[2],temp[1],temp[0]); temp = num; } return 0; }
0.0分
0 人评分
2^k进制数 (C++代码)使用递归方法浏览:721 |
【回文数(二)】 (C语言代码)浏览:730 |
剪刀石头布 (C语言代码)不知道怎么直接在scanf中用枚举变量浏览:1316 |
a+b浏览:433 |
Minesweeper (C语言描述,蓝桥杯)浏览:1126 |
1024题解浏览:808 |
1035 题解浏览:785 |
C语言程序设计教程(第三版)课后习题10.5 (C语言代码)浏览:546 |
整除问题 (C语言代码)浏览:526 |
简单的a+b (C语言代码)浏览:630 |