zoukankan      html  css  js  c++  java
  • zzulioj 1206 字符串的修改 (字符串修改)

    不难,理解一下直接过,代码如下:

    #include<stdio.h>
    #include<string.h>
    #include<math.h>
    #include<time.h>
    #include<ctype.h>
    #include<map>
    #include<set>
    #include<algorithm>
    #include<stdlib.h>
    #include<queue>
    #include<stack>
    using namespace std;
    int main()
    {
        char s1[201];
        char s2[201];
        int num[202];
        int n,i,j;
        scanf("%s%s",s1,s2);
        memset(num,0,sizeof(num));
        int same=0;
      int   a1=strlen(s1);
      int   a2=strlen(s2);
        for(i=0;i<strlen(s1);i++)
        {
            for(j=0;j<strlen(s2);j++)
            {
                if(s1[i]==s2[j]&&num[j]==0)
                {
                    num[j]=1;
                    same++;
                }
            }
        }
        if(a1>a2)
            printf("%d
    ",a1-a2+a2-same);
        else if(a1==a2)
        printf("%d
    ",a1-same);
        else
            printf("%d
    ",a2-a1+a1-same);
    
    }
  • 相关阅读:
    MySQL(后篇)
    数据库
    Ajax
    JQuery
    BOM & DOM
    CSS
    HTML
    Python之IO多路复用学习
    vue-router小记
    js中运算符的优先级
  • 原文地址:https://www.cnblogs.com/nr1999/p/8653318.html
Copyright © 2011-2022 走看看