![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
Peace_day
本人擅长Ai、Fw、FI、Br、Ae、Pr、Id、Ps、CDR等软件的安装与卸载,
精通CSS、JavaScript、PHP、ASP、C、C++、C#、Java、VB、Go、Ruby、Perl、Lisp、python、Objective-C、ActionScript、Pascal、spss、sas等单词的拼写,
熟悉Windows、Linux、Mac、Android、IOS、WP8等系统的使用
展开
-
1001. 害死人不偿命的(3n+1)猜想 (15)
很简单没什么说的。 #include<iostream> using namespace std; int main(){ int n; cin >> n; int flag = 0; while (n != 1){ if (n % 2 == 0) n/=2; else n = (3 * n + 1) / 2...原创 2018-04-22 08:53:51 · 86 阅读 · 0 评论 -
1009. 说反话 (20)
#include<bits/stdc++.h> using namespace std; int main(){ char str[105]; while(gets(str)!=NULL){ int len=0; while(str[len]!='\0')len++; int flag=len-1; ...原创 2018-04-28 10:08:02 · 118 阅读 · 0 评论 -
1010. 一元多项式求导 (25)
注意理解零多项式。 #include<bits/stdc++.h> using namespace std; int main(){ int n,e,flag=0; while(scanf("%d %d",&n,&e)!=EOF){ if(n*e){ if(!flag){ prin...原创 2018-04-28 10:12:06 · 78 阅读 · 0 评论 -
1011. A+B和C (15)
#include<bits/stdc++.h> using namespace std; int main(){ int n; double x1,x2,x3; while(scanf("%d",&n)!=EOF){ for(int i=1;i<=n;i++){ scanf("%lf %lf %lf",&am...原创 2018-04-28 10:12:57 · 245 阅读 · 0 评论 -
1012. 数字分类 (20)
#include<bits/stdc++.h> using namespace std; int main(){ int ans1=0,ans2=0,flag=0,ans3=0,ans5=0; double ans4=0,ave4; int num,total=0,n,i; int flag1=0,flag2=0,flag3=0,flag4=0,flag...原创 2018-04-28 10:14:00 · 108 阅读 · 0 评论 -
1013. 数素数 (20)
#include<bits/stdc++.h> using namespace std; bool solve(int n){ if(n==1||n==0)return 0; for(int i=2;i<=sqrt(n);i++) if(n%i==0)return 0; return 1; } int main(){ int...原创 2018-04-28 10:15:11 · 92 阅读 · 0 评论 -
1014. 福尔摩斯的约会 (20)
#include<bits/stdc++.h> using namespace std; char day[7][10]={"MON","TUE","WED","THU","FRI","SAT","SUN"}; int main(){ char str[4][61]; for(int i=0;i<4;i++)原创 2018-04-28 10:16:00 · 95 阅读 · 0 评论 -
1018. 锤子剪刀布 (20)
是锤子剪刀布!!!锤子剪刀布!! #include<bits/stdc++.h> using namespace std; char solve(int n1,int n2,int n3){ char ans; if(n1>=n2&&n1>=n3) ans='B'; else if(n2>n1&&a...原创 2018-04-29 08:51:06 · 103 阅读 · 0 评论 -
1019. 数字黑洞 (20)
#include<bits/stdc++.h> using namespace std; int a[4]; void divide(int n){ memset(a,0,sizeof(a)); int t=n; int i=0; while(t!=0){ a[i++]=t%10; t/=10; ...原创 2018-04-29 08:53:46 · 99 阅读 · 0 评论 -
1020. 月饼 (25)
简单的贪心算法 #include<bits/stdc++.h> using namespace std; struct StoreHouse{ double sum_price; double sum; double price; }; bool cmp(const StoreHouse &s1,const StoreHouse &s2){...原创 2018-04-29 08:55:13 · 145 阅读 · 0 评论 -
1021. 个位数统计 (15)
#include<bits/stdc++.h> using namespace std; int a[10]; int main(){ char str[1005]; while(scanf("%s",&str)!=EOF){ memset(a,0,sizeof(a)); for(int i=0;str[i]!='\0';i++)...原创 2018-04-29 08:56:22 · 93 阅读 · 0 评论 -
1022. D进制的A+B (20)
#include<bits/stdc++.h> using namespace std; int main(){ long long a,b; int m; while(scanf("%lld %lld %d",&a,&b,&m)!=EOF){ a=a+b; int ans[50],size=0; ...原创 2018-04-29 08:57:14 · 90 阅读 · 0 评论 -
1023. 组个最小数 (20)
//flag用来控制第一位数 #include<bits/stdc++.h> using namespace std; int main(){ int a[10]; while(scanf("%d",&a[0])!=EOF){ int size=a[0]; for(int i=1;i<=9;i++){ ...原创 2018-04-29 08:58:44 · 86 阅读 · 0 评论 -
1024. 科学计数法 (20)
//看的别人的找到的思路, 主要学到了%[0-9]这种输入,C语言果然厉害 #include<bits/stdc++.h> using namespace std; int main(){ char sign1,a,num[10005]={0},sign2; int b,length=0; scanf("%c%c.%[0-9]E%d",&sign1,...原创 2018-04-29 09:00:37 · 138 阅读 · 0 评论 -
1008. 数组元素循环右移问题 (20)
这道题不需要实现真正的模拟,脑子灵活一点,直接输出就好。 #include<bits/stdc++.h> using namespace std; int main(){ int n,m,a[105]; while(scanf("%d %d",&n,&m)!=EOF){ m=m%n; for(int i=0;i<n...原创 2018-04-28 10:06:59 · 92 阅读 · 0 评论 -
1007. 素数对猜想 (20)
#include<bits/stdc++.h> using namespace std; bool solve(int x){ for(int i=2;i<=sqrt(x);i++) if(x%i==0)return false; return true; } int main(){ int n; while(scanf("%d",...原创 2018-04-28 10:05:16 · 77 阅读 · 0 评论 -
1002. 写出这个数 (20)
#include<bits/stdc++.h> using namespace std; char* name[]={"ling","yi","er","san","si","wu","liu","qi","ba","jiu"}; int main(){ char a[105原创 2018-04-22 08:58:30 · 118 阅读 · 0 评论 -
1003. 我要通过!(20)
这道题题目有点难懂,只能总结出规律 设P前面A的个数为a P和T之间的A的个数为b ,T后面的个数为c 结论:a*b=c 通过第二条(这里注意两个X是一个变量)可以得到 n—–1——n是正确的 第三条说明 n—2—–2n是正确的把这一条继续带入第三条 得到 n—–3—–3n是正确的。。 结果显而易见。 #include...原创 2018-04-22 09:06:26 · 85 阅读 · 0 评论 -
1004. 成绩排名 (20)
很简单,没什么说的。 #include<bits/stdc++.h> using namespace std; struct Student{ char name[15]; char num[15]; int grade; }; bool cmp(const Student& s1,const Student& s2){ return ...原创 2018-04-22 09:19:35 · 103 阅读 · 0 评论 -
1005. 继续(3n+1)猜想 (25)
//主要思路就是设置一个flag[105],表示flag[a]表示a是否在计算中出现过,为什么105就够了?因为 //输入的数都是<=100的,计算出大于100的不需要标记,反正他也不会是答案! #include<bits/stdc++.h> using namespace std; int main(){ int n,a[105],flag[105]; wh...原创 2018-04-22 12:58:51 · 101 阅读 · 0 评论 -
1017. A除以B (20)
除数只有一位数!!很简单!! temp用来记录上一位除了之后剩下多少 flag主要用来判断是不是第一个数 比如12 7 没有flag就会输出 01 5 flag的作用就是消除这个零 这道题开始想复杂了,看了别人的题解豁然开朗 #include<bits/stdc++.h> using namespace std; int main(){ char num[100...原创 2018-04-30 10:03:51 · 109 阅读 · 0 评论 -
1025. 反转链表 (25)
参考地址 注意一点: 给的节点有的可能不在链表中 测试的最后一个点就是卡的这个 #include<bits/stdc++.h> #include<vector> using namespace std; struct Nod{ int addr; int value; int next; }; vector<Nod> v(1000...原创 2018-05-01 09:06:53 · 113 阅读 · 0 评论 -
1028. 人口普查(20)
大体思路: 直接把生日用char[]数组存起来,因为给的生日格式是固定的,比较谁小谁老直接比较字符就行; 然后根据人的年龄排序,筛除不合适的人; 最后注意结果为0的特殊情况 #include<bits/stdc++.h> using namespace std; struct pe{ char name[10]; char bir[20]; }a[100005]...原创 2018-05-01 21:03:54 · 154 阅读 · 0 评论 -
1029. 旧键盘(20)
用v[i]=1;表示ASCII为i的字符在str1中出现过; 注意变一下大小写就好, 我是直接把输入的两个字符的小写字母用对应的大写字母进行替换 #include<bits/stdc++.h> using namespace std; int main(){ int v[128]; char str1[81],str2[81]; while(scanf("...原创 2018-05-01 21:51:04 · 121 阅读 · 0 评论 -
1030. 完美数列(25)
#include<bits/stdc++.h> using namespace std; int main(){ int n,p; long long a[100005]; while(scanf("%d %d",&n,&p)!=EOF){ for(int i=0;i<n;i++) scanf("%l...原创 2018-05-01 22:25:07 · 148 阅读 · 0 评论 -
上海交通大学 Day of Week
#include<bits/stdc++.h> #define ISYEAP(x) x%4==0&&x%100!=0||x%400==0?1:0 using namespace std; int daymonth[13][2]={ 0,0, 31,31, 28,29, 31,31, 30,30, 31,31, 30...原创 2018-05-03 16:23:20 · 283 阅读 · 0 评论 -
1015. 德才论 (25)
这道题用C++比较简单,主要考察了结构体排序。 用四个vector来装不同类型学生 ,不要试图把所有类别放在一起然后到sort函数中实现排序。#include<bits/stdc++.h> using namespace std; struct Student{ char name[20]; int grade1,grade2; }; bool cmp(const Stud原创 2018-04-28 09:45:59 · 138 阅读 · 0 评论 -
1016. 部分A+B (15)
数据范围为0 < A, B < 10^10。 本题主要掌握long long 类型的输入 #include<bits/stdc++.h> using namespace std; int main(){ long long a,pa,b,pb,sum1=0,sum2=0,sum,temp=1; scanf("%lld %lld %lld %lld",...原创 2018-04-28 10:02:12 · 99 阅读 · 0 评论 -
1006. 换个格式输出整数 (15)
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(scanf("%d",&n)!=EOF){ int x1=n/100; n%=100; int x2=n/10; n%=10; int x3=n...原创 2018-04-28 10:04:08 · 104 阅读 · 0 评论 -
清华大学-约数的个数(考研复试)
#include<bits/stdc++.h> using namespace std; int solve(int k){ int ans=0,i; for(i=1;i*i<k;i++) if(k%i==0)ans+=2; if(i*i==k)ans+=1; return ans; } int main(){ int n,...原创 2018-04-29 09:04:04 · 240 阅读 · 0 评论