自定义博客皮肤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)
  • 收藏
  • 关注

原创 判断素数的函数片段

int prime(int a){int b=2;while(a%b!=0&&a>=b)b++;if(a==b)return 1;elsereturn 0;}//判断是否为素数,为素数返回1,否则返回0

2021-03-18 20:10:42 92

原创 跳一跳

#include<stdio.h>#include<string.h>int main(){int count,i,a[1000],sum=0,j;for(i=0;i<1000;i++){scanf("%d",&a[i]);if(a[i]==0)break;}for(i=0;i<1000;i++){count=1;if(a[i]==1)sum++;if(a[i]==2){if(a[i-1]==0||a[i-1]==1)sum=

2020-12-24 18:48:22 123 1

原创 求 a+aa+aaa+...aaaaa..

#include<stdio.h>int main(){int i,j,a,n,sum=0,term=0;printf(“Input a number:”);scanf("%d",&a);printf(“Input a number:”);scanf("%d",&n);for(i=1;i<=n;i++){term=term*10+a;sum=sum+term;}printf(“a+aa+aaa…+a…a=%d”,sum);return 0;}

2020-12-24 18:46:21 352 1

原创 通讯录排序

/输入第一行给出正整数n(<10)。随后n行,每行按照“姓名 生日 电话号码”的格式给出一位朋友的信息,其中“姓名”是长度不超过10的英文字母组成的字符串,“生日”是yyyymmdd格式的日期,“电话号码”是不超过17位的数字及+、-组成的字符串。/#include<stdio.h>#include<string.h>typedef struct node{char c[100];int a;char b[170];}d;int main(){d f[

2020-12-24 18:45:24 234 2

原创 A+B Format

A+B Format999999→999,999 A+B FormatCalculate a+b and output the sum in standard format – that is,the digits must be separated into groups of three by commas (unless there are less than four digits).#include<stdio.h>#include<math.h>int ma

2020-12-24 18:40:26 220 1

空空如也

空空如也

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

TA关注的人

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