标签:bin 实现 字符串 inf input 编程 1.0 res put
1 #include<stdio.h> 2 #include<string.h> 3 int main(){ 4 char s1[100],s2[100]; 5 scanf("%s%s",&s1,&s2); 6 int len1 = strlen(s1); 7 int len2 = strlen(s2); 8 if(len1 == len2){ 9 for(int i=0;i<len1;i++){ 10 if(s1[i] == s2[i]){ 11 printf("0"); 12 return 0; 13 } 14 } 15 }else if(len1<len2){ 16 for(int i=0;i<len1;i++){ 17 if(s1[i] != s2[i]){ 18 printf("%d",s1[i]-s2[i]); 19 return 0; 20 } 21 } 22 }else if(len1>len2){ 23 for(int i=0;i<len2;i++){ 24 if(s1[i] != s2[i]){ 25 printf("%d",s1[i]-s2[i]); 26 return 0; 27 } 28 } 29 } 30 }
标签:bin 实现 字符串 inf input 编程 1.0 res put
原文地址:http://www.cnblogs.com/panweiwei/p/6650663.html