文章

8

粉丝

27

获赞

24

访问

731

头像
字符串匹配 题解:只用一个主函数实现
P1378 北京航空航天大学机试题
发布于2025年2月10日 16:36
阅读数 157

没调用多个函数,纯在主函数内解决。

#include <bits/stdc++.h>
using namespace std;
            
            
int main(){

    int n;

    while(cin>>n)
    {
        vector<string> str1(1000," "),str2(1000," ");
        for(int i=0;i<n+1;i++)
        cin>>str1[i];
        for(int i=0;i<n+1;i++){
            int c=str1[i].size();
            str2[i]=str1[i];
            for(int j=0;j<c;j++){
                if(str1[i][j]<='Z'&&str1[i][j]>='A')
   &n...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发