自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 2021-04-24

如何输出一个数个各个位 逆序输出:例123 求个位 -> %10 丢个位 -> /=10 3 12 2 1 ...

2021-04-24 18:00:40 86

原创 数组

数组 类型 数组名【整型常量】 int ar[ 5 ] = {}; [ ] 内必须是 大于0的整数常量表达式 //C99中 [ ] 内可以是变量 int ar[5] = { 1, 2, 3, 4, 5}; printf(" %d " ,sizeof( ar)); 输出结果为 20; char br[6] = {“hello”}; printf(" %d " ,sizeof( br )); 输出结果为 6 ; int ar[] = {1,2,3}; int n; n = sizeof(ar)/si

2020-06-13 20:47:10 214

原创 strlen() sizeof()

int main() { int ar[5]={1,2,3,4,5}; char str1[10]={“hello”}; char str2[10]={‘h’,‘e’,‘l’,‘l’,‘o’}; char str3[]={“hello”}; char str4[]={‘h’,‘e’,‘l’,‘l’,‘o’}; return 0; } 因为 str1[10]={“hello”} str1[0] = ‘h’ str1[1] = ‘e’ str1[2] = ‘l’ str1[3] = ‘l’ str1[4

2020-06-12 13:23:47 128

原创 2020-06-03

break只能在switch/循环语句中使用 continue:结束本次循环 在while中跳转到判断 在for中 跳转到语句3

2020-06-03 17:32:01 122

原创 2020-06-03

逗号表达式 scanf(“%d”,&n); while(n!=0) { sum+=n; scanf(“%d”,&n); } 可以改写为 while(scanf(“%d”,&n),n!=0) { sum+=n; }

2020-06-03 17:17:45 96

原创 2020-06-03

循环语句 for( ; ; ) 条件可省略 while(1) 每次循环都需要判断 while( x ) x非0⃣️即为真 x不可以省略 如果省略程序报错

2020-06-03 17:09:39 112

原创 2020-06-03

函数 1.函数的声明 例 bool is_leapyear (int year); year 可省略 2.函数的定义 Bool is_leapyear (int year) { } 3.函数的调用 is_leapyear(year)

2020-06-03 17:03:32 121

原创 const

const 一定要要初始化 const int a = 1; int const a = 1; const int a[] = {};

2020-05-31 18:40:06 131

空空如也

空空如也

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

TA关注的人

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