标签:pid string ring else col code name std 并且
2020-02-20 16:14:05
1 #include<iostream> 2 #include<stdio.h> 3 #include<string.h> 4 using namespace std; 5 int main() 6 { 7 char str[1000]; 8 char exp[1000]; 9 int i = 0; 10 int j = 0; 11 int count = 0; 12 cin>>str; 13 cin>>exp; 14 int tag = 0; 15 while ((i < strlen(str) - 1) && (j < strlen(exp) -1)) 16 { 17 if (exp[j] == ‘.‘) 18 { 19 count = 0; 20 i++; 21 j++; 22 } 23 else if (exp[j] == ‘*‘) 24 { 25 count++; 26 if (count >= 2) 27 { 28 tag = 0; 29 break; 30 } 31 j++; 32 } 33 else 34 { 35 count = 0; 36 if (str[i] == exp[j]) 37 { 38 tag = 1; 39 i++; 40 j++; 41 } 42 else 43 { 44 i++; 45 } 46 } 47 } 48 49 50 if (tag) 51 { 52 cout<<"YES"<<endl; 53 return 0; 54 } 55 cout<<"NO"<<endl; 56 return 0; 57 } 58 //懵懵懂懂中,不晓得有多适用
标签:pid string ring else col code name std 并且
原文地址:https://www.cnblogs.com/dragondragon/p/12336331.html