摘要: // while循环, 输入int 判断 #include <stdio.h> main() { int num; int sum = 0; int status; status = scanf_s("%d", &num); //如果不是输入int,scanf返回0,如果输入int返回1 while 阅读全文
posted @ 2020-05-25 23:57 abel2020 阅读(240) 评论(0) 推荐(0) 编辑
摘要: //找出数组中最大值,数组和指针的关系 #include <stdio.h> int max( int *, int ); main() { int Largest; int a[5] = { 1,3,4,11,2 }; int* pa = a; //a本身就是地址;不能用&a ,是二次指针 //p 阅读全文
posted @ 2020-05-25 23:28 abel2020 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 1 // 简单函数调用 2 3 #include <stdio.h> 4 5 void fun(int i); //函数原型声明,编译时告诉编译器形参为int 6 7 main() { 8 int i = 4; 9 char ch = 'A'; 10 11 //printf("%d\n", ch); 阅读全文
posted @ 2020-05-25 23:16 abel2020 阅读(60) 评论(0) 推荐(0) 编辑