码迷,mamicode.com
首页 > 其他好文 > 详细

字符串函数

时间:2018-11-15 21:17:37      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:cst   clu   bsp   std   函数   ace   asc   字符   lse   

 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 }

 

字符串函数

标签:cst   clu   bsp   std   函数   ace   asc   字符   lse   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!