intmain() { cin.tie(nullptr)->sync_with_stdio(false); string s; for (; getline(cin, s);) { for (int i = 0, n = s.size(); i < n; i = i + 8) { string each = ""; if (i + 8 < n) { each = s.substr(i, 8); } else { each = s.substr(i); for (int k = 8 - each.size(); k--; each += '0'); } cout << each << endl; } } return0; }
publicclassMain{ publicstaticvoidmain(String[] args){ Scanner in = new Scanner(System.in); for (; in.hasNext(); ) { String s = in.nextLine(); for (int i = 0, n = s.length(); i < n; i += 8) { // StringBuilder sb = new StringBuilder(); String t; if (i + 8 < n) { t = s.substring(i, i + 8); } else { t = s.substring(i, n); for (int j = 0, len = t.length(); j < 8 - len; j++) { t += '0'; } } System.out.println(t); } } } }