Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- char c;
- int sum = 0;
- while (scanf("%c", &c) != '.')
- {
- if (c == '.') {
- break;
- }
- int digit = 0;
- if (c >= 'A' && c <= 'F') {
- digit = c - 'A' + 10;
- } else if(c>= 'a' && c<='f') {
- digit = c - 'a' + 10;
- } else if (c>='0' && c <='9') {
- digit = c - '0';
- }
- sum+= digit;
- }
- if (sum % 16 == 0) {
- if ((sum %10 == 6) && ((sum/10)%10 == 1)) {
- printf("Poln pogodok");
- } else {
- printf("Pogodok");
- }
- } else {
- printf("%d\n", sum);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement