车厢的货物
This commit is contained in:
@@ -1,22 +1,15 @@
|
|||||||
#include "iostream"
|
#include "iostream"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int n;
|
int a[105], n;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
cin >> n;
|
cin >> n;
|
||||||
if (n != 1) {
|
for (int i = 1; i <= n; i++) {
|
||||||
while (n > 1) {
|
cin >> a[i];
|
||||||
if (n % 2 == 0) {
|
|
||||||
n = n / 2;
|
|
||||||
} else {
|
|
||||||
n = n * 3 + 1;
|
|
||||||
}
|
}
|
||||||
cout << n << " ";
|
for (int i = 1; i <= n; i++) {
|
||||||
}
|
cout << a[i];
|
||||||
cout << endl << "END";
|
|
||||||
} else {
|
|
||||||
cout << "END";
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user