Pascal:
var n,sum:integer;
begin
sum:=0;
write ('N = ');
readln (n);
while n <> 0 do
begin
sum:=sum+(n mod 10);
n:=n div 10;
end;
if sum = 10 then writeln ('YES') else writeln ('NO');
end.
C++:
#include
using namespace std;
int main()
{
int n,sum = 0;
cout <<"N = ";<br> cin >>n;
while (n!=0)
{
sum+=n%10;
n/=10;
}
if (sum==10)
cout <<"YES" <<endl;<br> else cout <<"NO" <<endl;<br> return 0;
}