随笔分类 -  PTA-Basic level

摘要:#include <math.h> #include <vector> #include <iostream> using namespace std; int main() { int n; cin>>n; vector <int> say(n+1); for(int i=1;i<=n;i++) 阅读全文
posted @ 2020-02-07 17:43 QRain 阅读(229) 评论(0) 推荐(0)
摘要:#include <math.h> #include <iostream> using namespace std; int main() { int m,x,y,a,b=0,tmp1,tmp2; double c,tmp3,tmp4; cin>>m>>x>>y; for(a=99;a>=10;a- 阅读全文
posted @ 2020-02-07 09:26 QRain 阅读(139) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; int main() { int result[100005]={0}; int n,r,count=0; cin>>n; for(int i=1;i<=n;i++) { r=i/2+i/3+i/5; if(resul 阅读全文
posted @ 2020-02-06 11:08 QRain 阅读(97) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; int main() { int a,b,c,d,w=0; cin>>a>>b; c=a*b; if(c==0) { cout<<"0"; return 0; } do { d=c%10; if((w==0&&d!=0 阅读全文
posted @ 2020-02-06 11:00 QRain 阅读(130) 评论(0) 推荐(0)
摘要:#include <math.h> #include <string.h> #include <iostream> using namespace std; bool isPrime(long int num) { if(num==0||num==1) return false; for(int i 阅读全文
posted @ 2020-02-06 10:04 QRain 阅读(132) 评论(0) 推荐(0)
摘要:#include <string.h> #include <iostream> using namespace std; int main() { char a[1000005],b[1000005],c[127]={0}; fgets(a,1000005,stdin); fgets(b,10000 阅读全文
posted @ 2020-02-05 11:15 QRain 阅读(154) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; int main() { int n,m; int sale[1005]={0},s,w=0; cin>>n>>m; for(int i=1;i<=m;i++) { for(int j=1;j<=n;j++) { ci 阅读全文
posted @ 2020-02-05 11:04 QRain 阅读(120) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; int main() { int m,k,r,i; cin>>m; for(int j=0;j<m;j++) { cin>>k; for(i=1;i<10;i++) { r=i*k*k; if((k<10&&(r-k) 阅读全文
posted @ 2020-02-05 10:49 QRain 阅读(109) 评论(0) 推荐(0)
摘要:#include <math.h> #include <stdio.h> int main() { double r1,p1,r2,p2,g1,g2; scanf("%lf %lf %lf %lf",&r1,&p1,&r2,&p2); g1=r1*r2*cos(p1)*cos(p2)-r1*r2*s 阅读全文
posted @ 2020-02-05 10:11 QRain 阅读(146) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; #include <stdio.h> int main() { int n,tno,tsno,grade,max=0,max_i=1; int t_g[1005]={0}; scanf("%d",&n); for(in 阅读全文
posted @ 2020-02-03 12:05 QRain 阅读(128) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; int main() { int n,a=0,b=0,x1,x2,y1,y2; cin>>n; for(int i=0;i<n;i++) { cin>>x1>>x2>>y1>>y2; if(x2!=y2) { if(x 阅读全文
posted @ 2020-02-03 11:59 QRain 阅读(92) 评论(0) 推荐(0)
摘要:#include <string.h> #include <iostream> using namespace std; int main() { char str[10005]; int c_p=0,c_a=0,c_T=0,c_e=0,c_s=0,c_t=0; cin>>str; for(int 阅读全文
posted @ 2020-02-02 16:32 QRain 阅读(136) 评论(0) 推荐(0)
摘要:#include <string.h> #include <iostream> using namespace std; int main() { char str[1005]; int big[27]={0}; int max=0; char max_s; fgets(str,1005,stdin 阅读全文
posted @ 2020-02-02 16:10 QRain 阅读(104) 评论(0) 推荐(0)
摘要:#include <string.h> #include <iostream> using namespace std; struct STU { char stu_no[18]; int test_seat; int seat; }; int main() { int n,m; struct ST 阅读全文
posted @ 2020-02-02 16:00 QRain 阅读(179) 评论(0) 推荐(0)
摘要:#include <string.h> #include <iostream> using namespace std; int main() { long int num=1000000007,count=0,count_p=0,count_t=0; char * str=new char[100 阅读全文
posted @ 2020-02-02 15:51 QRain 阅读(121) 评论(0) 推荐(0)
摘要:#include <string.h> #include <iostream> using namespace std; int main() { char sell[1005],want[1005]; int s[1005]={0}; int j,n=0; cin>>sell>>want; for 阅读全文
posted @ 2020-02-02 12:59 QRain 阅读(122) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; int main() { int n,k,g; int grade[101]={0}; cin>>n; int *k_grade=new int[100005];//稍微大一点 for(int i=0;i<n;i++) 阅读全文
posted @ 2020-02-02 12:47 QRain 阅读(138) 评论(0) 推荐(0)
摘要:#include <stdio.h> int main() { int g1,s1,k1,g2,s2,k2,g,s,k,g3,g4,s3,s4,k3,k4; scanf("%d.%d.%d %d.%d.%d",&g1,&s1,&k1,&g2,&s2,&k2); g3=g1;g4=g2;s3=s1;s 阅读全文
posted @ 2020-02-02 12:29 QRain 阅读(110) 评论(0) 推荐(0)
摘要:#include <iostream> using namespace std; int main() { int n,t; char c; cin>>n>>c; for(int i=0;i<n;i++) cout<<c; t=n/2+n%2;//计算行数 for(int i=0;i<t-2;i++ 阅读全文
posted @ 2020-02-02 11:21 QRain 阅读(95) 评论(0) 推荐(0)
摘要:#include <string.h> #include <iostream> using namespace std; int main() { char damage[70]; char *word=new char[100005];//不超过10^5 //char word[10005];一开 阅读全文
posted @ 2020-02-02 09:06 QRain 阅读(165) 评论(0) 推荐(0)