自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 蛇形填数 描述 在n*n方陈里填入1,2,...,n*n,要求填成蛇形。例如n=4时方陈为: 10 11 12 1 9 16 13 2 8 15 14 3 7 6 5 4

#include <stdio.h>int main() { int a[100][100]; int m,n,M,N,x,y,i,j,t=0; scanf("%d",&M); N=M;for(x=0,y=M-1;N>0;N=N-2,x++,y--) { for(m=x,n=y,i=0;i<N;i++,m++) { t++; a[m][n]=t; }  for...

2018-04-16 21:02:26 2350

原创 设计一个从5个整数中取最小数和最大数的程序 输入输入只有一组测试数据,为五个不大于1万的正整数输出输出两个数,第一个为这五个数中的最小值,第二个为这五个数中的最大值,两个数字以空格格开。

#include <stdio.h>int main() { int i,j,k,t; int c[10]; scanf("%d %d %d %d %d",&c[0],&c[1],&c[2],&c[3],&c[4]); for(i=0,k=1;i<4;i++,k++) { for(j=k;j<5;j++) { if(c[i]&g...

2018-04-12 09:04:44 3074

原创 Each test case is described by one line having the format "note tonality", where "note" is one of th

#include <stdio.h>#include <string.h>int main() { int i=0; char s1[20],s2[20]; while(scanf("%s %s",s1,s2)!=EOF) { i++; if(strcmp(s1,"A#")==0) printf("Case %d: Bb %s\n",i,s2); else if(st...

2018-04-10 17:03:22 181

原创 无穷数列1,1,2,3,5,8,13,21,34,55...称为Fibonacci数列,它可以递归地定义为 F(n)=1 ...........(n=1或n=2) F(n)=F(n-1)+F(n-2)

#include <stdio.h>int main() {int f[20],i,j,a,n;f[1]=1,f[2]=1;scanf("%d",&n);while(n--) {scanf("%d",&i);j=i-2,a=2;while(j--) {a++;f[a]=f[a-1]+f[a-2];}printf(" %d\n",f[i]);}}

2018-04-05 19:37:19 3845

原创 输入三个字符(可以重复)后,按各字符的ASCII码从小到大的顺序输出这三个字符。

#include <stdio.h>#include <stdlib.h>int main(int argc, char *argv[]) {int a,b,i,j=0,t;char c[20];scanf("%d",&a); getchar();for(i=0;i<a;i++) {scanf("%c%c%c",&c[j],&c[j+1],&a

2018-04-05 19:36:11 2761

空空如也

空空如也

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

TA关注的人

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