開啟章節選單
11634
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n&&n) { set<int>st; while(st.count(n)==0) { st.insert(n); n=n*n/100%10000; } cout<<st.size()<<endl; } return 0; }
開啟章節選單
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n&&n) { set<int>st; while(st.count(n)==0) { st.insert(n); n=n*n/100%10000; } cout<<st.size()<<endl; } return 0; }