• 等级
  • 16351 访问
  • 56 原创
  • 0 转发
  • 96718 排名
  • 6 评论
  • 10 获赞

PAT考试乙级1057(C语言实现)

#include<stdio.h>#include<string.h>#include<ctype.h>intmain(){intnum,i,len,sum=0,c1=0,c2=0;chara[10001];gets(a);len=strlen(a);for(i=0;i<len;i++){if('a'<=tolow

2017-12-02 22:22:20

PAT考试乙级1056(C语言实现)

#include<stdio.h>intmain(){intn,i=0,j=0,a[11],sum1=0,sum2=0;scanf("%d",&n);for(i=0;i<n;i++){scanf("%d",&a[i]);sum1+=a[i];}sum2=sum1*11*(n-1);printf("%

2017-12-02 22:20:19

PAT考试乙级1055(C++语言实现) (重点题目)(思路)

#include<iostream>#include<cstring>#include<algorithm>usingnamespacestd;structStudent{charname[10];intheight;};boolcmp(structStudents1,structStudents2){if(s1.height!=s2.h

2017-12-02 22:16:45

PAT考试乙级1054(C语言实现) (重点题目)(思路)

#include<stdio.h>#include<stdlib.h>intlegal(chara[]){intdot=0,i=0,n1=0,n2=0;if(a[0]=='-')i=1;//跳过逗号计算数值for(;a[i]!='\0';i++){//下面四句判断的顺序不能改变!!!if((a[i]<48||a[i

2017-12-01 22:32:24

PAT考试乙级1053(C语言实现)

#include<stdio.h>intmain(){intN,D,i,j,K,empty=0,mayempty=0,c=0;doublee,select;scanf("%d%lf%d",&N,&e,&D);for(i=0;i<N;i++){c=0;//一定不要忘记恢复初值scanf("%d",&K);

2017-11-30 21:22:40

PAT考试乙级1050(C语言实现) (重点题目)(按格式读取,使用容器vector)

#include<iostream>#include<string>usingnamespacestd;intget(stringhand,stringa[]){//用于把初始三个字符串转换成不含[]的三个string数组intk=0;for(inti=0;i<hand.size();i++){if(hand[i]!='['&&hand

2017-11-29 18:34:24

PAT考试乙级1050(C语言实现) (重点题目)(关于保留小数的坑)

#include<stdio.h>#include<math.h>intmain(){intnum,i;doubleR1,P1,R2,P2,R,P;scanf("%lf%lf%lf%lf",&R1,&P1,&R2,&P2);P=R1*R2*(cos(P1+P2));R=R1*R2*(sin(P1+P2));if(P>-0

2017-11-29 17:39:13

PAT考试乙级1050(C语言实现) (重点题目)(memset以及思路)

#include<cstring>#include<iostream>#include<algorithm>usingnamespacestd;intmain(){intnum=0,i=0,j=0,m=0,n=0,min,k=0;inta[10005];scanf("%d",&num);min=num;for(i=0;i<num;i

2017-11-28 19:36:48

PAT考试乙级1049(C语言实现)

#include<stdio.h>intmain(){intnum,i;doublea[100001],sum=0;scanf("%d",&num);for(i=0;i<num;i++){scanf("%lf",&a[i]);sum+=a[i]*(num-i)*(i+1);}printf("%.

2017-11-28 17:18:52

PAT考试乙级1048(C语言实现)重点题目(思路、用到了memset)

#include<stdio.h>#include<string.h>intmain(){chara[101]={0},tempb[101]={0},b[101]={0},lst[14]="0123456789JQK";intlen1,len2,i;scanf("%s%s",a,tempb);len1=strlen(a);len2=s

2017-11-27 21:28:51

PAT考试乙级1047(C语言实现)

#include<stdio.h>intmain(){intnum,i,c[1001]={0},g,n1,n2,max=0,t=0;scanf("%d",&num);for(i=0;i<num;i++){scanf("%d-%d%d",&n1,&n2,&g);c[n1]+=g;}for(i=0;i<100

2017-11-27 17:24:52

PAT考试乙级1045(C语言实现)重点题目(思路)

#include<iostream>#include<algorithm>#include<string.h>usingnamespacestd;intmain(){intnum=0,i=0,max=0,count=0;inta[100005]={0},b[100005]={0},m[100005]={0};scanf("%d",&num);

2017-11-25 17:58:11

PAT考试乙级1046(C语言实现)

#include<stdio.h>intmain(){intnum,i,c1=0,c2=0;inta1,a2,b1,b2;scanf("%d",&num);for(i=0;i<num;i++){scanf("%d%d%d%d",&a1,&a2,&b1,&b2);if(a2!=a1+b1&&b2==a1+b1)

2017-11-25 14:19:02

PAT考试乙级1044(C语言实现) (用到了strstr())

#include<stdio.h>#include<string.h>typedefstructtempString{char*mars;}tempString;intmain(){intn,i,j,num=0,len;chartemp[10];tempStringlow[13]={"tret","jan","feb

2017-11-25 12:47:09

PAT考试乙级1043(C语言实现)

#include<stdio.h>#include<string.h>#include<ctype.h>intmain(){chara[10001],count[70001]={0};inti,len1,P=0,A=1,T=2,e=3,s=4,t=5;gets(a);len1=strlen(a);for(i=0;i<len1;i++){

2017-11-23 15:01:38

PAT考试乙级1042(C语言实现)

#include<stdio.h>#include<string.h>#include<ctype.h>intmain(){charc[1001];intcount[1001]={0},i,len1,max=0,temp;gets(c);len1=strlen(c);for(i=0;i<len1;i++){count[t

2017-11-23 14:44:39

PAT考试乙级1041(C语言实现)

#include<stdio.h>typedefstructStu{longlongnum;intseat1;intseat2;}Stu;intmain(){Stustu[1000];intN,M,i,j,s1[1000];scanf("%d",&N);for(i=0;i<N;i++){s

2017-11-23 14:30:00

PAT考试乙级1040(C语言实现)

#include<stdio.h>#include<string.h>intmain(){intlen,i,t=0,at=0,pat=0;charstr[100000];gets(str);len=strlen(str);for(i=len-1;i>=0;i--){if(str[i]=='T'){

2017-11-23 14:04:23

PAT考试乙级1039(C语言实现)

#include<stdio.h>#include<string.h>intmain(){charsale[1005],red[1005],ch;intcount[150]={0},len1,len2,i,count1=0,count2=0;gets(sale);gets(red);len1=strlen(sale);len2=s

2017-11-23 12:27:35

PAT考试乙级1038(C语言实现)

#include<stdio.h>#include<math.h>intmain(){intnum1,grade[100000],num2,count[100000],i,b[105]={0};scanf("%d",&num1);for(i=0;i<num1;i++){scanf("%d",&grade[i]);b[grade

2017-11-23 12:06:08

JeffreyDDD

关注
奖章
  • 持之以恒