#include <iostream.h>
#include <conio.h>
int main()
{
int v[1000],i,c=3,n;
cout<<"Dati n: ";cin>>n;
do{for (i=0;i<c;i++)
{
v[i]=n%10;
n=n/10;
}
n=0;
for (i=0;i<c;i++)
n+=v[i];c--;
}while (c!=1);
if (c==1)
cout<<"Cifra de control: "<<n;
getch();
return 0;
}