自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 PAT乙级,C语言版,题解

由于本人非科班出身,刷题时遇到许多麻烦,故写此总结希望能帮助一些像我一样刚开始遇到困难的初学者。不过本人水平有限,能得满分的题不多,有很多题都会扣个几分,也希望大佬能帮助本人指出错误。1001(15)(15)...

2020-02-16 16:30:53 2489 3

原创 安装TensorFlow踩坑

如果你pip安装TensorFlow尝试了一堆版本还是没有匹配的,可以试试换个源+换个网,随机组合,这是我折腾好久的经验。pip install tensorflow -i http://pypi.douban.com/simple --trusted-host pypi.douban.com1)http://mirrors.aliyun.com/pypi/simple/ 阿里云2)https://pypi.mirrors.ustc.edu.cn/simple/ 中科大3)http://pypi.d

2022-03-05 11:33:33 871

原创 1059 C语言竞赛,C

#include <stdio.h>int isshu(int j) //判断是否为素数{ int i,flag=1; if(j==2) return flag; else{ for(i=2;i<=j/2;i++) if(j%i==0) {flag=0;break;} return flag...

2020-03-10 22:06:41 118

原创 1058 选择题,C

#include <stdio.h>typedef struct{ int score,useless,right;//score是每题正确得分,useless是每题有多少选项,right是每题正确的选项个数 char op[6]; //op[6]用来按顺序储存正确的选项}questions;int main(){ int max=0,countw[100]={0...

2020-03-10 22:05:33 154

原创 1057 数零壹,C

#include <stdio.h>int main(){ //char volume[100001]={0}; char volume=0; int x=0; int i=0,count1=0,count0=0; //scanf("%c",volume); while( (volume=getchar()) != '\n' ) {...

2020-03-10 22:03:21 117

原创 1056 组合数的和,C

#include <stdio.h>int main(void){ int n,i=0,sum=0,j=0,volume[20]={0}; scanf("%d",&n); while(i<n) { scanf("%d",&volume[i++]); } for(i=0;i<n-1;i++)...

2020-03-10 22:02:25 107

原创 1054 求平均值,C

#include <stdio.h>#include <stdlib.h>int main(){ int n,i=0,flag=-1,point[10]={0},minus[10]={0},j=0,k=0,l=0,max[10]={0},m=0; char rec[100]={0},wrong[100][50]={0}; double right[100]={0...

2020-03-10 22:01:39 133

原创 1053 住房空置率,C

#include <stdio.h>int main(){ int n,d,x,i,flag,sum=0; double e,obs,va,ma,vacant=0.0,may=0.0; scanf("%d %lf %d",&n,&e,&d); sum = n; while(n--) { i=0;flag=0; scanf("%d",&a...

2020-03-10 22:00:17 83

原创 1052 卖个萌,C

#include <stdio.h>int main(){ char hand[10][6]={0},eye[10][6]={0},mouth[10][6]={0},c; int i=0,n,a1,a2,a3,a4,a5; while((c=getchar())!='\n') if(c=='[') scanf("%[^]]",hand[i++]); i=0;...

2020-03-10 21:59:14 108

原创 1051 复数乘法,C

#include <stdio.h>#include <math.h>int main(){ double a,b,c,d,b1,d1,b2,d2; scanf("%lf %lf %lf %lf",&a,&b,&c,&d); b1 = cos(b); b2 = sin(b); d1 = cos(d); d2 = sin(d)...

2020-03-10 21:55:36 114

原创 1046 划拳,C

#include <stdio.h>int main(){ int flag1,flag2,shout1,shout2,gesture1,gesture2,n,a=0,b=0; scanf("%d",&n); while(n--) { flag1=0;flag2=0; scanf("%d %d %d %d",...

2020-03-02 17:41:54 94

原创 1047 编程团体赛,C

#include <stdio.h>int main(){ int n,score,useless,i=0,max=-1,m=0; int a[1001]={0}; scanf("%d",&n); while(n--) { scanf("%d-%d %d",&i,&useless,&score)...

2020-03-02 17:37:06 119

原创 1048 数字加密,C

这题要注意如果B中数字位数少于A中位数,要在B的前面补0;如果B中数字位数多于A,则不需要再给A补0,因为结果不变#include <stdio.h>int main(){ int i=0,j=0,flag=1,x=0,k=0; char a[101]={0},b[101]={0},c[101]={0}; scanf("%s %s",a,b); while(a[i]) ...

2020-03-02 17:36:30 163

原创 1049 数列的片段和,C

题解目录#include <stdio.h>int main(){ double sum=0.0,a[100001]={0}; long int reserve=0,n,i=1; scanf("%ld",&n); reserve = n; while(i<=n) { scanf("%lf",&a[i]); i++; } i=1;...

2020-03-02 17:33:21 105

原创 1041 考试座位号,C

#include <stdio.h>typedef struct{ char adnumber[17]; int number1,number2;}student;int main(){ int n,i=0,x=0; student a[1000]={0}; scanf("%d",&n); while(n--) ...

2020-03-01 00:11:01 82

原创 1042 字符统计,C

#include <stdio.h>int main(){ char a[1001]={0}; int b[26]={0}; int i=0,n=0,max=-1,x=0; scanf("%[^\n]",a); while(a[i]) { if(a[i]>64 && a[i]<91) ...

2020-03-01 00:09:58 107

原创 1043 输出PATest,C

#include <stdio.h>int main(){ char a[10001]={0},b[10001]={0},c[10001]={0}; int i=0,j=0,x=0,z=0; scanf("%s",a); while(a[i]) { if(a[i]=='P' || a[i]=='A' || a[i]=='T'...

2020-03-01 00:09:19 90

原创 1044 火星数字,C

#include <stdio.h>int main(){ int ziti=0,n=0,wuguan,i=0,x=0,gw=0,dw=0; //ziti=1是数字,ziti=0是火星文 char a[10]={0}; char d[14][5]={"tret","jan","feb","mar","apr","may","jun","jly", "aug", "...

2020-03-01 00:07:31 103

原创 1039 到底买不买,C

#include <stdio.h>int main(){ char a[1001]={0},b[1001]={0}; int i=0,j,flag,c=0; //c是没有的珠子数 scanf("%s %s",a,b); while(b[i]) { j=0; flag=0; while(a[j]) { if(b[i] == a[j]) { ...

2020-02-26 19:06:07 89

原创 1036 跟奥巴马一起编程,C

#include <stdio.h>int main(){ int n,x=0,i=0; //n个,x行 char c; scanf("%d %c",&n,&c); if( (n%2) ) x = n/2+1; else x = n/2; x=x-2; while(i<...

2020-02-26 17:10:42 105

原创 1037 在霍格沃茨找零钱,C

#include <stdio.h>int main(){ long int a1,a2,b1,b2,c1,c2,x=0,a3=0; int flag=1; //1为正 scanf("%ld.%ld.%ld %ld.%ld.%ld",&a1,&b1,&c1,&a2,&b2,&c2); a1 = a1*29*17 + ...

2020-02-26 17:09:49 81

原创 1038 统计同成绩学生,C

写这题的时候思路不好,最开始的想法是把每个成绩都放在a[100000]中,然后挨个查找,但是这样太慢,导致最后一个得分点(6)分得不到后改进思路,把成绩放入a[101]中,只统计每个分数出现多少次,这样运行时间大大缩短#include <stdio.h>int main(){ int n,k,i=0,x,j=0; int a[101] = {0}; in...

2020-02-26 17:07:43 142

原创 1034 有理数四则运算,C

#include <stdio.h>void hj(long int a, long int b) //“化简并输出”函数{ long int c=0,x=1,flag=0,ma,mb; if(a<0 && b<0) {a=a*(-1); b=b*(-1);} if(a<0 && b>0) {a=a*(-1); prin...

2020-02-26 15:32:27 171

原创 1033 旧键盘打字,C

#include <stdio.h>#include <string.h>int main(){ char a[100099]={0},b[100001]={0},c[100001]={0},d[50]={0}; // a坏,b入,c出,d补 int dx=1,i=0,j=0,r,k=0,l=0; scanf("%s %s",a,b); while(a...

2020-02-25 20:45:19 100

原创 1032 挖掘机技术哪家强,C

#include <stdio.h>int main(){ //int a[100003] = {0};提前占用好内存也可以,不过占用较大空间 int n,x,score,max=-1,m=-1,n2=0,n3; scanf("%d",&n); int a[n]; n2 = n; n3 = n; while(n2) ...

2020-02-25 18:29:29 125

原创 1031 查验身份证,C

#include <stdio.h>int main(){ int n,i=0,state=1,sum=0; char a[19]={0}; int qz[17] = {7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2}; char bijiao[11] = {'1','0','X','9','8','7','6','5','...

2020-02-24 16:40:13 240

原创 1029 旧键盘,C

#include <stdio.h>int main(){ int i=0,j=0,k=0,l=0,flag; char a[100]={0},b[100]={0}; char c[100]={0},d[100]={0}; scanf("%s %s",a,b); while(a[i]) { if(a[i] == b[j])...

2020-02-24 16:39:04 88

原创 1028 人口普查,C

这题做的时候不严谨,简单把一年按照365天,一月30天来算,但是基本能满足题目要求#include <stdio.h>typedef struct{ char name[6]; char age[11];}people;int change(char * a){ int y=0,m=0,d=0,x=0; y = y + (a[0]-'0')*1000; y = y...

2020-02-24 16:37:56 108

原创 1027 打印沙漏,C

#include <stdio.h>int main(){ int i=1,n=1,a,c=0,x=0,d=0; //c剩余,d最大行 char b; scanf("%d %c",&a,&b); if(a>=1 && a<7) printf("%c\n%d",b,a-1); e...

2020-02-24 16:34:42 79

原创 1026 程序运行时间,C

#include <stdio.h>int main(){ int a,b,h=0,m=0,s=0; scanf("%d %d",&a,&b); a = (b-a) /100; if( (a%100) >= 50 ) a++; h = a/3600; m = (a%3600)/60; s = (...

2020-02-24 16:33:44 130 2

原创 1024 科学计数法,C

这题挺麻烦的,各种小数点和正负号搞的乱死,看的时候要看仔细了,我特意用1.1~2.3标出了6种情况,实际上只分了3种,前3种情况理解了,后面的就是对应地方都-1的问题#include <stdio.h>#include <math.h>int main(){ char a[20000] = {0}; //输入 char b[20000] = {0}; //输出...

2020-02-20 18:11:45 223

原创 1023 组个最小数,C

#include <stdio.h>int main(){ char a[50]={0}; int i,n=0,j=0; for(i=0;i<10;i++) { scanf("%d",&n); while(n) { a[j]=i+'0'; j++; n--; } } n=j; //有a[n]字符串中有n个数字...

2020-02-20 00:19:08 110

原创 1022 D进制的A+B,C

#include <stdio.h>int main(){ int a,b,m,i=0; long int x; char c[70] = {0}; scanf("%d %d %d",&a, &b, &m); x = a+b; if(x<m) printf("%d",x); //只输出一位数 else{ //多位...

2020-02-19 23:38:49 92 1

原创 1021 个位数统计,C

#include <stdio.h>int main(){ char a[1000] = {0}; int n,i,x; scanf("%s",a); for(i=0; i<=9; i++) //从0到9依次检查有几个,并输出 { n=0;x=0; while( a[n] ) { if( (a[n]-'0') == i ) x++; ...

2020-02-19 18:40:36 106

原创 1015 德才论,C

只得了16分,我原以为是准考证号太长,int存不下,然后改用long int型,但是结果还是16分。#include <stdio.h>int paixu(int* a, int* aa,int* aaa,int n){ int i=0,j=0,k=0; for(i=0; i<n-1; i++) for(j=i+1; j<n; j++) { if(...

2020-02-18 20:39:59 213

原创 1019 数字黑洞,C

#include <stdio.h>int daxiao(char * a){ int i,j,k; for(i=0; i<3; i++) for(j=i; j<4; j++) if(a[i] < a[j]) { k = a[j]; a[j] = a[i]; a[i] = k; } return 0;}...

2020-02-18 17:13:48 141

原创 1018 锤子剪刀布,C

#include <stdio.h>int main(){ char a[1000]={0}; char b[1000]={0}; int i=0,c1=0,c2=0,c3=0,d1=0,d2=0,d3=0,j=0,h=0,n; int cc=0,cb=0,cj=0,dc=0,db=0,dj=0,m=0; scanf("%d\n",&n); while(n-...

2020-02-18 17:11:09 121

原创 1017 A除以B,C

#include <stdio.h>int main(){ char a[1000]={0}; char c[1000]={0}; int i=0,b=0,d=0; scanf("%s %d",a ,&b); while(a[i]) { c[i]=((a[i]-'0')+d*10)/b + '0'; d = ((a[i]-'0')+d*10)%b;...

2020-02-18 17:06:19 136

原创 1016 部分A+B,C

#include <stdio.h>#include <math.h>int main(){ int a1,b1,a2=0,b2=0,a3=0,b3=0,i=0; char a[10]={0}; char b[10]={0}; scanf("%s %d %s %d",a,&a1,b,&b1); while(a[i]) { if...

2020-02-18 17:04:43 119

原创 1014 福尔摩斯的约会,C

#include <stdio.h>int main(){ int i=0,j=0,DAY=0,hour,minute; char a[60] = {0}; char b[60] = {0}; char c[60] = {0}; char d[60] = {0}; scanf("%s %s %s %s",a,b,c,d); while(a[i] &&amp...

2020-02-18 17:03:10 103

空空如也

空空如也

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

TA关注的人

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