自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 温度转化

temp = input("请输入带单位的温度:")if temp[-1] in ['t','T']: if eval(temp[0:-1])>=0: C = eval(temp[0:-1])-273.15 print("摄氏温度为{:.2f}C".format(C)) else: print("不存在该温度")elif t...

2018-05-26 21:25:00 738

原创 成绩

#include<stdio.h>int main(){ int i,j,x=0,y=0,max; int a[3][5]; float ave1,ave2,fc; for(i=0;i<3;i++) { printf("please enter the %d student grade:",i+1); for(j=0;j<5;j++) scanf("%d...

2018-05-17 17:49:45 263

原创 短除法求两个数的最大公约数和最小公倍数

#include <stdio.h>int main(){ int i,a,b,j=1,k=0,gcd,lcm; printf("Please enter two number:\n"); scanf("%d %d",&a,&b); while(1) { k=0; for(i=2;i<=a || i<=b;i++) { ...

2018-05-16 22:44:40 688

原创 草稿

#include<stdio.h>int copy(int a[8][8],int b[8][8]){ int i,j; for(i=0;i<8;i++) { for(j=0;j<8;j++) { a[i][j]=b[i][j]; } }}int f(char ch){ int i,j; int mid[8][8]; int n[...

2018-05-15 18:37:21 109

原创 输出100以内与3有关的数

#include "stdio.h"int main(){ int i,n=0; for(i=1;i<=100;i++) { if(i%3==0) { n++; printf("%d、",i);continue; } if(i/10==3) { n++; printf("%d、",i);continue; } i...

2018-05-05 23:17:19 1802

原创 矩阵行列互换

#include<stdio.h> void change(int a[3][3]) { int b[3][3]; int x,y; for(x=0;x<3;x++) { for(y=0;y<3;y++) { b[x][y]=a[y][x]; ...

2018-05-03 17:48:23 7766 2

原创 16进制数转化为10进制数

#include<stdio.h>int main(){char s[50];scanf("%s",s);int t;long sum=0;for(int i=0;s[i];i++){if(s[i]<='9')t=s[i]-'0';elset=s[i]-'A'+10;sum=sum*16+t;}printf("%ld\n",sum);return ...

2018-05-03 07:27:10 4771

原创 自定义字符串连接函数

#include<stdio.h>void f(char s1[],char s2[]){ int i=0,j=0; while(s1[i]!='\0') i++; while(s2[j]!='\0') s1[i++]=s2[j++];}main(){ char s1[10],s2[10]; scanf("%s",s1); scanf("%s",s2);...

2018-05-03 07:26:01 2233

原创 字符串逆序存放

#include <stdio.h> #include<string.h>void f(char s[],int n){ n=strlen(s); for(int i=0,j=n-1;i<j;i++,j--) { char c=s[i]; s[i]=s[j]; s[j]=c; ...

2018-05-03 00:28:40 7169

原创 字符串连接函数、复制函数、长度函数

需调用函数库#include<string.h>#include<stdio.h>#include<string.h> main(){ char s1[10],s2[10]; printf("请输入s2字符串:"); scanf("%s",s2); strcpy(s1,s2); printf("s1:%s",s1);}#include&l

2018-05-02 23:11:07 251

原创 递归求数组最大值

#include<stdio.h> #define N 10 int sort(int arr[],int n) { int max; if(n==0) { return arr[0]; } else { max=sort(arr,n-1); ...

2018-05-01 10:42:51 14292 3

原创 递归求最大公约数

#include <stdio.h>int gcd(int a,int b){ if(a<=0 || b<=0) return 0; //如果传进来的参数小于0则返回0 if(a%b==0) return b; //如果b能被a整除则b就是最大公约数 else gcd(b,a%b); ...

2018-05-01 10:17:27 37267 6

原创 Fibonacci 数列

#include<stdio.h>int f(int n){ int s; if(n==1||n==2) s=1; else s=f(n-1)+f(n-2); return s;}main(){ int n,s; scanf("%d",&n); s=f(n); printf("%d",s);}

2018-05-01 09:52:11 106

空空如也

空空如也

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

TA关注的人

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