Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int z, n, sum,prvacifra,cifra;
- scanf("%d",&z);
- prvacifra = z / 1000;
- n = z % 1000;
- sum = 0;
- while (n > 0) {
- cifra = n % 10;
- sum += cifra;
- n /= 10;
- }
- if (sum == prvacifra) printf("DA");
- else
- printf("NE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement