自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 射击比赛

#include<stdio.h>int main(){ int N; scanf("%d",&N); int tmp[3]={0}; scanf("%d %d %d",&tmp[0],&tmp[1],&tmp[2]); int killer[3]={tmp[0],tmp[1],tmp[2]}; int greenhand[3]={tmp[0],tmp[1],tmp[2]}; int i; for(i=0;i<(N-1

2020-05-26 09:52:32 139

原创 有多少不同的值

#include<stdio.h>#include<math.h>int main(){ int judge[10500]={0};/*1/2+1/3+1/5==31/30;10000*31/30==10354*/ int countn=0; int N; scanf("%d",&N); int i; for(i=1;i<=N;i++) { int tmp=(int) floor(i/2)+floor(i/3)+floor(i/5);

2020-05-26 09:21:44 101

原创 字符串A+B

#include<stdio.h>int main(){ int judge_ch[127]={0}; int list[127]={0};/*从结果的角度设置数组的长度*/ int count_list=0; int i; for(i=0;i<2;i++) { char ch; while((ch=getchar())!='\n') { if(judge_ch[ch]==0) { list[count_list]=ch; c

2020-05-26 09:07:09 309

原创 谷歌的招聘

#include<stdio.h>#include<math.h>#include<stdbool.h>int judgeprime(int n){ if(n==0||n==1) { return false; } int i; for(i=2;i*i<=n;i++) { if(n%i==0) { return false; } } return true;}int r

2020-05-26 08:49:08 165

原创 打印沙漏

#include<stdio.h>int main(){ int N; char ch; scanf("%d %c",&N,&ch); int m=1; for(m=1;((1+m)*(1+m))/2-1<=N;m+=2); m-=2; int i,j; for(i=0;i<m;i++) { for(j=0;j<m;j++) { if(i+1>=-1*(j+1)+m+1&&i+1>=j+.

2020-05-25 22:32:51 69

原创 A+B 和 C

#include<stdio.h>#include<stdbool.h>int main(){ int T=0; bool answer[11]={0}; int count_answer=0; scanf("%d",&T); for(;T>0;T--) { long int A,B,C;/*长度设置:long*/ scanf("%ld %ld %ld",&A,&B,&C); if(A+

2020-05-09 14:30:10 91

原创 一元多项式求导

#include<stdio.h>#include<stdbool.h>int main(){ int count=0; int A,B; char ch; while(scanf("%d %d",&A,&B)==2) { if(A!=0&&B!=0) { if(count!=0) printf(" "); printf("%d %d",A*B,B-1); count++; } } if

2020-05-09 14:28:46 125

原创 说反话

#include<stdio.h>int main(){ int ns[40][20]={0}; int h,l; char ch; for(h=0;(ch=getchar())!='\n';h++) { for(l=0;ch!=' '&&ch!='\n';l++)/*注意ch可能取值,仔细设置条件*/ { ns[h][l]=ch; ch=getchar(); } if(ch=='\n') { break; } }

2020-05-09 14:27:27 56

原创 数组元素循环右移问题

在读取数据时直接存储到相应位置#include<stdio.h>int main(){ int N,M; int ns[101]={0}; scanf("%d %d",&N,&M); M=M%N; int i; for(i=M;i<N;i++) { scanf("%d",&ns[i]); } for(i=0;i<M;i++) { scanf("%d",&ns[i]); } for(i=

2020-05-09 14:26:04 59

原创 素数对猜想

#include<stdio.h>#include<stdbool.h>#include<math.h>bool judge_prime(int n){ int i=2; int j=(int)sqrt(n)+1;/*+1*/ for(i=2;i<j;i++) { if(n%i==0) { return false; } } return true;}int main(){ int N=0; int ns[1000

2020-05-09 14:24:41 165

原创 1006 换个格式输出整数

写的有点冗长,有时间再改#include<stdio.h>int main(){ int n; int num[3]={0}; scanf("%d",&n); num[0]=n/100; n=n%100; num[1]=n/10; n=n%10; num[2]=n; int i=0; for(i=0;i<num[0];i++) { printf("B"); } for(i=0;i<num[1];i++) { printf(

2020-05-09 14:23:00 53

原创 继续(3n+1)猜想

#include<stdio.h>#define length 10000int main(){ int K,n; int ns[length]={0}; int answer[100]={0}; int count_answer=0; scanf("%d",&K); while(K>0) { scanf("%d",&n); ns[n]=2; K--; } int i=0; for(i=0;i<=length;i++)

2020-05-09 14:21:25 50

原创 成绩排名

成绩排名#include<stdio.h>#include<string.h>struct data{ char names[11]; char stdnum[11]; double result;};int main(){ int N=0; int count_N=0; struct data results[200]={0}; int i=...

2020-04-21 09:36:40 100

原创 我要通过!

我要通过!“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于 PAT 的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。得到“答案正确”的条件是:字符串中必须仅有 P、 A、 T这三种字符,不可以包含其它字符; 任意形如 xPATx 的字符串都可以获得“答案正确”,其中 x或者是空字符串,或者是仅由字母 A 组成的字符串; ...

2020-04-20 11:14:25 89

原创 写出这个数

写出这个数#include<stdio.h>int main(){ char ch='0'; int n=0; int sum=0; for(sum=0;(ch=getchar())!='\n';sum+=n) { n=ch-'0'; } int k=1; while(sum/k>=10) { k*=10; } for(;k>...

2020-04-20 07:51:02 217

原创 害死人不偿命的(3n+1)猜想

害死人不偿命的(3n+1)猜想#include<stdio.h>int main(){ int n=0; int count=0; scanf("%d",&n); for(count=0;n!=1;count++) { if(n%2==0) n=n/2; else n=(3*n+1)/2; } printf("%d",count);...

2020-04-20 07:10:35 75

空空如也

空空如也

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

TA关注的人

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