Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<conio.h>
- #include<math.h>
- #define ou printf(
- #define in scanf(
- int sum(int n);
- main()
- {
- int n;
- ou"Nhap vao so n = ");
- in"%d",&n);
- ou"tong cac chu so trong %d la %d",n,sum(n));
- }
- int sum(int n)
- {
- int s=0;
- while (n!=0)
- {
- s+=n%100;
- n/=100;
- }
- return s;
- }
Advertisement
Add Comment
Please, Sign In to add comment