Advertisement
Jisan_129

Untitled

Jul 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<conio.h>
  4. int main(){
  5. int a,b,c,i,j;
  6. char str1[100],str[200],ok[100],ok2[100];
  7. gets(str1);
  8. fflush(stdin);
  9. gets(ok);
  10. c=strlen(str1);
  11. for(i=0;i<c;i++){
  12. str[i]=toupper(str1[i]);
  13. ok2[i]=toupper(ok[i]);
  14.  
  15. }
  16. str[i]='\0';
  17. ok[i]='\0';
  18. for(i=0;i<c;i++){
  19. b=(int)str[i]-(int)ok2[i];
  20. //printf("%d",b);
  21. if(i!=c-1&&b==0){
  22. continue;
  23. }
  24. else if(b>0){
  25. printf("%d",1);
  26. break;
  27. }
  28. else if(b<0){
  29. printf("%d",-1);
  30. break;
  31. }
  32.  
  33. if(i==c-1&&b==0){
  34. printf("%d",0);
  35. }
  36.  
  37.  
  38. }
  39. //printf("%s\n",str);
  40. //printf("%s",ok2);
  41.  
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement