pat
pat
harrylee777
这个作者很懒,什么都没留下…
展开
-
String Subtraction (20 分)
1050 String Subtraction (20 分) #include <cstdio> int hashtable[256] = {0}; int main(){ char str1[10010],x; x = getchar(); int i =0; while(x!='\n'){ str1[i++] = x; x = getchar(); } x = getchar(); while(x!=原创 2021-07-18 23:13:54 · 75 阅读 · 0 评论 -
1041 Be Unique (20 分
1041 Be Unique (20 分) #include <cstdio> #include <vector> using namespace std; const int maxn = 100010; int hashtable[maxn] = {0}; int main(){ int n,x; vector<int> a; scanf("%d",&n); for(int i =0;i<n;i++){ s原创 2021-07-18 22:15:32 · 69 阅读 · 0 评论 -
1001 A+B Format (20 分)
1001 A+B Format (20 分) #include <cstdio> #include <cstring> int main(){ int a,b,c,n; char str[15]; scanf("%d %d",&a,&b); c = a+b; if(c<0){ sprintf(str,"%d",c*-1); printf("-"); } else sprintf(str,"%d",c); n = strlen(str);原创 2021-07-17 22:21:52 · 78 阅读 · 0 评论 -
1025 PAT Ranking (25 分)
注意cmp的使用 bool cmp(a x,a y){ if(x.score!=y.score) return x.score>y.score; else return strcmp(x.info,y.info)<0; } #include <cstdio> #include <cstring> #include <algorithm> using namespace std; struct a{ char info[20];原创 2021-07-16 22:57:13 · 78 阅读 · 0 评论