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

All in All,( UVa, 10340 )

时间:2018-02-25 20:35:30      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:color   style   链接   ror   strlen   ble   tchar   tps   net   

题目链接 :https://vjudge.net/problem/UVA-10340

注意数组开辟大小,太小会runtime error;

 1 #include<stdio.h>
 2 #include<string.h>
 3 #define maxn 10000000
 4 char s[maxn],t[maxn];
 5 
 6 int main()
 7 {
 8     while (scanf("%s %s",s,t)!=EOF)
 9     {
10         int j = 0;
11         int len_s = strlen(s);
12         int len_t = strlen(t);
13         for (int i = 0;i < len_t;i++)
14             {
15                 if(s[j] == t[i])
16                 {
17                     j++;
18                 }
19             }
20         if(j == len_s)
21         printf("Yes\n");
22         else
23         printf("No\n");
24         getchar();
25     }
26     return 0;
27 } 

 

All in All,( UVa, 10340 )

标签:color   style   链接   ror   strlen   ble   tchar   tps   net   

原文地址:https://www.cnblogs.com/Dicer/p/8470113.html

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