首页 > 其他 > 详细

字符串函数

时间:2018-11-15 20:40:32      阅读:124      评论:0      收藏:0      [点我收藏+]
 1 #include <cstdio>
 2 #include <iostream>
 3 #include <algorithm>
 4 #include <cstring>
 5 #define f(x) x*x*x
 6 using namespace std;
 7 char  s[10],p[10];
 8 int  main()
 9 {
10     scanf("%s%s",s,p);
11     /*
12     strcat(s,p);
13     printf("%s\n%s\n",s,p);
14     wegfr
15     wgtr
16     wegfrwgtr
17     wgtr
18     */
19     /*
20     strcpy(s,p);
21     printf("%s\n%s\n",s,p);
22     affer
23     e
24     e
25     e
26    */
27    if(strcmp(s,p)==0){
28        printf("0\n");
29        /*
30        wert
31       wert
32       0
33 */
34    }
35    else if(strcmp(s,p)>0){
36        printf("1\n");
37        /*
38        wert
39        ascd
40        1
41 */
42    }
43    else{
44        printf("-1\n");
45       // egfwtg
46       //ewfr
47       //-1
48    }
49 }

 

字符串函数

原文:https://www.cnblogs.com/tingtin/p/9965855.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!