#include<stdio.h>
int main(){
int num,sum=0,r;
printf("Buhel too oruul: ");
scanf("%d",&num);
while(num){
r=num%10;
num=num/10;
sum=sum+r;
}
printf("Tsifruudiin niilber:
%d",sum);
return 0;
}
Гаралт:
Buhel too oruul: 123
Tsifruudiin niilber : 6
No comments:
Post a Comment
http://groups.google.com/group/teacher_it_mongolia