• 等级
  • 9026 访问
  • 56 原创
  • 0 转发
  • 95597 排名
  • 1 评论
  • 2 获赞

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

#include<stdio.h> #include<string.h> #include<ctype.h> int main(){ int num,i,len,sum=0,c1=0,c2=0; char a[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> int main(){ int n,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> using namespace std; struct Student{ char name[10]; int height; };bool cmp(struct Student s1,struct Student s2){ if(s1.height!=s2.h

2017-12-02 22:16:45

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

#include<stdio.h> #include<stdlib.h> int legal(char a[]){ int dot = 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> int main(){ int N,D,i,j,K,empty=0,mayempty=0,c=0; double e,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> using namespace std; int get (string hand,string a[]){//用于把初始三个字符串转换成不含[]的三个string数组 int k=0; for(int i=0;i<hand.size();i++){ if(hand[i]!='['&&hand

2017-11-29 18:34:24

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

#include<stdio.h> #include<math.h> int main(){ int num,i; double R1,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> using namespace std; int main(){ int num=0,i=0,j=0,m=0,n=0,min,k=0; int a[10005]; scanf("%d",&num); min=num; for(i=0;i<num;i

2017-11-28 19:36:48

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

#include<stdio.h> int main(){ int num,i; double a[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> int main(){ char a[101]={0},tempb[101]={0},b[101]={0},lst[14]="0123456789JQK"; int len1,len2,i; scanf("%s %s",a,tempb); len1=strlen(a); len2=s

2017-11-27 21:28:51

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

#include<stdio.h> int main(){ int num,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> using namespace std; int main(){ int num=0,i=0,max=0,count=0; int a[100005]={0},b[100005]={0},m[100005]={0}; scanf("%d",&num);

2017-11-25 17:58:11

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

#include<stdio.h> int main(){ int num,i,c1=0,c2=0; int a1,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> typedef struct tempString { char *mars; }tempString; int main(){ int n,i,j,num=0,len; char temp[10]; tempString low[13]={"tret", "jan", "feb

2017-11-25 12:47:09

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

#include<stdio.h> #include<string.h> #include<ctype.h> int main(){ char a[10001],count[70001]={0}; int i,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> int main(){ char c[1001]; int count[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> typedef struct Stu{ long long num; int seat1; int seat2; }Stu; int main(){ Stu stu[1000]; int N,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> int main(){ int len,i,t=0,at=0,pat=0; char str[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> int main(){ char sale[1005],red[1005],ch; int count[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> int main(){ int num1,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

关注
奖章
  • 持之以恒