Advertisement
wojiaocbj

Untitled

Mar 14th, 2023
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <ctype.h>
  5. #include <string.h>
  6. int main(){
  7.     int m, n, xor, d = 0, i;
  8.     scanf("%d%d", &m, &n);
  9.     xor= m ^ n;
  10.     for(i = 0;i < 32;i++){
  11.         if(xor &(1 << i)){
  12.             d++;
  13.         }
  14.     }
  15.     printf("%d\n", d);
  16.     if(d == 1){
  17.         puts("mandarin duck");
  18.     }
  19.     else if(d <= 4){
  20.         puts("G00d friends!");
  21.     }
  22.     else if(d <= 12){
  23.         puts("common friends");
  24.     }
  25.     else if(d <= 25){
  26.         puts("broad communication");
  27.     }
  28.     else{
  29.         puts("strangers");
  30.     }
  31.     //putchar('\n');
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement