自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 PAT1032

#include<bits/stdc++.h>using namespace std;int main(){ int l1,l2,n,pos=-1; cin>>l1>>l2>>n; int m[100005]={0}; for(int i = 0 ; i < n; i++){ int temp...

2020-04-02 17:46:52 83

原创 素数表 两种筛选法代码模板

埃氏筛选法bool vis[maxn]memset( vis,0,sizeof(vis));vector<int>p;void sift(int n){ for(int i = 2; i * i <= n ; i++){ if(!vis[i]){ p.push_back(i); for(int j = i*i ; j < n ; j += i) ...

2020-03-22 18:51:14 105

原创 PAT甲级1010

坑:1.进制的取值范围,不是2-36,而是比较的串中最大的数字+1 ~ 基准数的值2.10位数字,应该用long long类型而不是int3.二分法的细节,题目要求的是最小的匹配值#include<bits/stdc++.h>using namespace std;long long convert(string num,long long radix){ long...

2020-03-14 14:37:58 96

原创 1082 Read Number in Chinese (25分)

题意:将一串数字转换成中文读法思路:按照中文读法的规律,将数字按每四位为一组分三组进行处理,如果各组加和>0则加上后缀亿或万。因此第一步是读入数字识别正负,提取数字到一个数组且补零到12位。for循环,3组进行分别细节0的处理。细节1:第一个数字输入前不能有空格,用count来进行标记;细节2:零的处理,有两种情况要补零(1)组内补零:如1001,101,此时的0就要输出ling...

2020-03-04 19:57:17 102

原创 1077 Kuchiguse (20分) PAT中gets()替代方法

The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called ...

2020-03-04 12:20:36 204

原创 1035 Password (20分)

1035 Passwordo prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (on...

2020-03-04 01:15:28 146

原创 PAT A1001 A+B Format

PAT A1001 A+B Format题意:A、B两数相加,结果按照每三个数字用“,”隔开,难点在于将数字倒序存在数组**思路1:**使用sprintf函数将数字的绝对值转换为字符组,然后将字符组转置(符号先行判断输出)#include<bits/stdc++.h>using namespace std;void reverse(char str[]){ char...

2020-03-03 21:49:47 65

原创 PAT 1048 数字加密(20 分)

1048 数字加密 (20分)本题要求实现一种数字加密方法。首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10、Q 代表 11、K 代表 12;对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 10。这里令个位为第 1 位。输入格式:输入在一行中依次给出 ...

2020-03-03 16:34:06 113

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除