Untitled
unknown
plain_text
3 years ago
596 B
2
Indexable
Never
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sisi[n]; int luas[n]; for (int i = 0; i < n; i++) { cin >> sisi[i]; luas[i] = sisi[i] * sisi[i]; } int luasGanjil[n]; int lengthArr = 0; for (int i = 0; i < n; i++) { if (luas[i] % 2 != 0 && luas[i] % 3 == 0) { luasGanjil[i] = luas[i]; cout << luasGanjil[i] << " "; lengthArr += 1; } } cout << "\n" << lengthArr << endl; return 0; }