![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT(basic)
文章平均质量分 75
txdzdlxx
这个作者很懒,什么都没留下…
展开
-
PAT(BASIC)1039. 到底买不买(20)
#include#include#includeint main(void){ using namespace std; string str_solder,str_buyer; map solder; map buyer; cin>>str_solder>>str_buyer; for(auto c:str_solder) ++solder[c]; for(auto c:原创 2015-04-04 09:56:21 · 840 阅读 · 0 评论 -
1025. 反转链表 (25)
#include#include#include#includeint main(void){ using namespace std; map m1; map m2; int first_add; int n; int i; cin>>first_add>>n>>i; int nn=n; while(nn){ int address; int num;原创 2015-04-06 14:55:20 · 382 阅读 · 0 评论 -
1030. 完美数列(25)
#include#include#includeint main(void){ using namespace std; int n,m; double p; double a[100000]; scanf("%d%lf",&n,&p); for(m=0;m<n;++m){ scanf("%lf",&a[m]); } sort(a,a+n); int max=0; f原创 2015-04-06 15:32:44 · 375 阅读 · 0 评论 -
PAT(BASIC)1028. 人口普查(20)
其实一次便利就行了的,不过懒,懒得改,写的实在太麻烦了,还好通过了- -#include#include#includeusing namespace std;struct data{ string name; unsigned yy; unsigned mm; unsigned dd;};int main(void){ int n; int avail=0; cin>>原创 2015-04-05 10:38:19 · 727 阅读 · 0 评论 -
PAT(BASIC)1029. 旧键盘(20)
#include#include#include#includeint main(void){ using namespace std; string str1,str2; cin>>str1>>str2; for(auto &c:str1){ if(islower(c)) c=toupper(c); } for(auto &c:str2){ if(islow原创 2015-04-05 14:42:34 · 447 阅读 · 0 评论 -
PAT(BASIC)1015. 德才论 (25)
//用cout老是运行超时,改用c风格的printf就可以了#include#include#include#include#includeusing namespace std;struct data{ unsigned id; unsigned de; unsigned cai; unsigned sum;};bool comp(data d1,data d2){原创 2015-04-05 11:26:06 · 412 阅读 · 0 评论 -
PAT(BASIC)1033. 旧键盘打字(20)
#include#include#includeint main(void){using namespace std;int hasher[255]={0};char c;while((c=getchar()) && (c!='\n')){if(c=='+'){for(char t = 'A';t hasher[t]=1;}else if(isupp原创 2015-04-05 15:14:11 · 437 阅读 · 0 评论 -
PAT(BASIC)1005 继续3n+1猜想
#include#include#include#includeusing namespace std;vector re_vector(int i);int main(void){ int n; cin>>n; vector> sum; int temp; while(n){ bool tag=false; cin>>temp; for(auto out:sum原创 2015-04-04 17:16:17 · 437 阅读 · 0 评论 -
PAT(BASIC)1037. 在霍格沃茨找零钱(20)
代码确实有点冗长,请见谅。#includestruct money{ int Galleon; int Sickle; int Kunt;};int main(void){ using namespace std; money should_pay,pay,resault; char c; cin>>should_pay.Galleon>>c>>should_pay.Sickl原创 2015-04-04 10:59:56 · 1299 阅读 · 1 评论 -
(看了别人的idea)1040. 有几个PAT(25)
这道题想死想不出,于是百度了,看了别人的想法之后,只能说太巧妙了。作为新手程序员的我还需要更加努力啊!!!!!!!#include#includeint main(void){ using namespace std; string str; unsigned num_t=0; unsigned num_at=0; unsigned num_pat=0; cin>>str; fo原创 2015-04-07 18:43:44 · 790 阅读 · 0 评论