sivan_iut

Untitled

Feb 20th, 2020
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 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.     sivan=toupper(sivan);
  10.     shammo=toupper(shammo);
  11.     int length=strlen(sivan);
  12.     int i;
  13.     int a=0;
  14.     for(i=0; i<length; i++)
  15.     {
  16.  
  17.         if(sivan[i]<shammo[i])
  18.           {
  19.             printf("1");
  20.             a++;
  21.             break;
  22.           }
  23.         if(sivan[i]>shammo[i])
  24.             {
  25.                 printf("-1");
  26.                 a++;
  27.                 break;
  28.             }
  29.  
  30.     }
  31.      if(a==0)
  32.             printf("0");
  33.     return 0;
  34. }
Add Comment
Please, Sign In to add comment