![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
lj779323436
这个作者很懒,什么都没留下…
展开
-
PAT1039. 到底买不买(20)
其实这个题挺简单的,代码如下:#includeusing namespace std;int main(){ int num1[123]={0},num2[123]={0}; //'z'的ASCII码:122 char str1[10001],str2[1001]; bool flag=true; int count1=0,count2=0; //count1:差的数目,cou原创 2016-10-26 12:29:50 · 280 阅读 · 0 评论 -
1040. 有几个PAT(25)
思路:每一个A能组合成PAT的个数等于这个A前面的P的个数乘以这个A后面的T的个数下面贴代码:注释都写上来了,大家可以参考参考。#includeusing namespace std;int main(){ char ch[100000]; long sum=0,p=0,t=0; scanf("%s",ch); for(int i=0;ch[i]!='\0';i++){原创 2016-10-28 12:51:41 · 291 阅读 · 0 评论 -
十六进制转八进制
C++实现#include#includeusing namespace std;int main(){ int n; cin>>n; string hex[n]; string bin[n]; for(int i=0;i<n;i++) cin>>hex[i]; for(int j=0;j<n;j++) for(int i=0;i<hex[j].length();i++原创 2017-01-23 16:27:36 · 370 阅读 · 0 评论