uite aici e o sursa in c++. daca ai nevoie ti.o pot transcire si in psudocod. sper ca am fost de ajutor
#include <iostream>using namespace std;long long n,i=1,a,v[100],s,aux;;int main(){ while (cin>>a && a!=0) v[i++]=a; for (int j=2; j<i; j++) { s=0,aux=v[j-1]; while (aux!=0) s+=aux%10,aux/=10; if (v[j]==v[j-1]%s) cout<<'('<<v[j-1]<<','<<v[j]<<") "; } return 0;}