sivan_iut

Untitled

Feb 20th, 2020
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     char sivan[1000];
  6.     char shammo[1000];
  7.     gets(sivan);
  8.     gets(shammo);
  9.     int length=strlen(sivan);
  10.     int i;
  11.     for(i=0; i<length; i++)
  12.     {
  13.         printf("%d",sivan[i]);
  14.         printf("%d",shammo[i]);
  15.         if(sivan[i]==shammo[i])
  16.             printf("0");
  17.         if(sivan[i]<shammo[i])
  18.             printf("-1");
  19.  
  20.         if(sivan[i]>shammo[i])
  21.             printf("1");
  22.  
  23.  
  24.     }
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.     return 0;
  36. }
Add Comment
Please, Sign In to add comment