题目地址:https://www.nowcoder.com/pat/6/problem/4065

题意:用数组统计好字符,最后进行相减,最后进行统计

 /**
*
*作者:Ycute
*时间:2019-12-05-14.11.53
*题目题意简单描述:用数组统计好字符,最后进行相减,最后进行统计
*/ #include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std; int main(){
char temp[];
int flag[]={};
scanf("%s",temp);
for(int i=;i<strlen(temp);i++){
flag[temp[i]]++;
}
getchar();
scanf("%s",temp);
for(int i=;i<strlen(temp);i++){
flag[temp[i]]--;
}
int j=;//标记到底是缺还是盈
int sum=;
int sub=;
for(int i=;i<;i++){
if(flag[i]<){
j=;
sub-=flag[i]; }else{
sum+=flag[i];
}
}
if(j==){
printf("No %d\n",sub);
}else{
printf("Yes %d\n",sum);
}
return ;
}

最新文章

  1. [LeetCode] Range Sum Query - Mutable 区域和检索 - 可变
  2. (原) 2.1 Zookeeper原生API使用
  3. GUID 全局统一标识符的介绍
  4. CIImage实现滤镜效果
  5. WP7推送通知服务
  6. maven实战_01_搭建maven开发环境
  7. 【SVN】删除文件/文件夹 svn: E205007: Could not use external editor to fetch log message
  8. 十个最常见的Java字符串问题
  9. c#安全性、稳定性、高性能需要注重的点
  10. Font Awesome 4.0.3 字体图标完美兼容IE7
  11. 深入理解HTTP Session
  12. G1收集器-原创译文[未完成]
  13. c# 替换所有中文、标点符号,全角转半角
  14. STL - priority_queue(优先队列)
  15. web应用
  16. OpenGL中的常用绘图的命令与效果(经验设置)
  17. [NLP/Attention]关于attention机制在nlp中的应用总结
  18. IntelliJ IDEA 进行多线程调试
  19. Python学习笔记4-os,sys模块
  20. SharePoint 2013 升级

热门文章

  1. 虚拟机 NAT 网络静态ip配置记录
  2. MacOS下JDK8的安装与配置
  3. matplotlib 去掉坐标轴
  4. PHP round() 函数
  5. 6.3 省选模拟赛 Decompose 动态dp 树链剖分 set
  6. JS&amp;ES6学习笔记(持续更新)
  7. Redis实现商品热卖榜
  8. 利用mvc模式,实现用户的注册
  9. VulnHub靶场学习_HA: Natraj
  10. 7月15日考试 题解(链表+状压DP+思维题)