解题思路:
注意事项:
参考代码:
/* //输入2字符串 //枚举相同字符串(参考字符串为外循环,修改字符串是内循环) //较长字符串长度-相同字符数量 */ #include <cstdio> #include <algorithm> #include <iostream> #include <cstring> using namespace std; int main(){ char ch1[205]; char ch2[205]; gets(ch1); gets(ch2); int cnt=0; for(int i=0;i<strlen(ch2);i++){ for(int j=0;j<strlen(ch1);j++){ if(ch2[i]==ch1[j]) cnt++; } } cout<<strlen(ch1)-cnt; return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:545 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:1071 |
C二级辅导-计负均正 (C语言代码)浏览:598 |
Hello, world! (C语言代码)浏览:1201 |
P1002 (C语言代码)浏览:980 |
【亲和数】 (C语言代码)浏览:541 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:634 |
1014题解浏览:485 |
Tom数 (C语言代码)浏览:527 |
Pascal三角 (C语言代码)浏览:652 |