include
using namespace std;
int main() {
bool t=false;
int i;
int d;
int tab[30];
while (t==false){
cin >> d;
if (d>=1 && d<=30) t = true;
else t=false;
}
for (i=0; i<d; i++){
cin >> tab[i];
if (tab[i]<0 || tab[i]>1000000000) i=i-1;
}
for (i=0; i<d; i++){
if (tab[i]==1) cout << 0 << " " << 1 << endl;
else if (tab[i]==2) cout << 0 << " " << 2 << endl;
else if (tab[i]==3) cout << 0 << " " << 6 << endl;
else if (tab[i]==4) cout << 2 << " " << 4 << endl;
else if (tab[i]==5) cout << 2 << " " << 0 << endl;
else if (tab[i]==6) cout << 2 << " " << 0 << endl;
else if (tab[i]==7) cout << 4 << " " << 0 << endl;
else if (tab[i]==8) cout << 2 << " " << 0 << endl;
else if (tab[i]==9) cout << 8 << " " << 0 << endl;
else cout << 0 << " " << 0 << endl;
}
return 0;
}
Dodam, że jestem początkujący i nie wiedziałem jak to zautomatyzować dla tych 9 cyfr. Jest to wymagane?