当前位置:网站首页>Data analysis of akali teaching Bureau in the first half of the fifth set
Data analysis of akali teaching Bureau in the first half of the fifth set
2022-07-21 20:33:00 【Cold hands a】
// You can calculate the total scores of Chinese and Mathematics for your brother in grade three
//#include<stdio.h>
//int main()
//{
// int chinese = 0;
// int math = 0;
// scanf_s("%d %d", &chinese, &math);
// int sum = chinese + math;
// printf("sum = %d\n", sum);
// return 0;
//}
// If you want to calculate the total score of Chinese and Mathematics for the whole class ? List the repeated codes , That's a lot low ah That's where the function comes in
//#include<stdio.h>
//int ADD(int chinese, int math) //int Function type ;ADD Function name ;( Function parameter 1, Function parameter 2)
//{
// return chinese + math;//return Function return value type
//}
Like what to eat Pull what meat ( Acid food ) Eat into your stomach Excretion is acidic
//int main()
//{
// int chinese = 0;
// int math = 0;
// scanf_s("%d %d", &chinese, &math);
// int sum =ADD(chinese, math);
// printf("sum = %d\n", sum);
// return 0;
//}
/*----------------------------------------------------------------
We talked about one-dimensional array , It can be understood as X Axis ; Two dimensional arrays are X-Y Axis ( Plane coordinate system )
*/
#include<stdio.h>
int main()
{
int group[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };// One dimensional array
int group_two[][3] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };// Two dimensional array Equivalent to three rows and three columns
Visit a one-dimensional array
//printf("%d\n", group[0]);
//printf("%d\n", group[1]);
//printf("%d\n", group[2]);
// Access one-dimensional array in a circular way The same goes for two-dimensional arrays
int frequency = 0;
while (frequency < 9) {
printf("%d\n", group[frequency]);
frequency++;
}
// Calculate the total size of the array Calculate the size of an element
printf("group = %d\n", sizeof(group));//9 Elements , One int Occupy 4 Bytes 4*9=36
printf("group[0]=%d\n", sizeof(group[0]));//4
// Calculate the total size of the array / Calculate the size of an element = Element number
int number = sizeof(group) / sizeof(group[0]);
printf("number = %d\n", number);
Access 2D array
//printf("%d\n", group_two[2][0]);// visit [][] You have to write the subscript
// Take one-dimensional array for example , The subscript is from 0 At the beginning , You want to get 1, Is access group[0],o Subscript at , And so on
return 0;
}
边栏推荐
猜你喜欢
Hetai ht32 & taojingchi tjc--t0 serial port screen learning notes
无法从“boost::shared_ptr<pcl::RangeImage>”转换为“const std::shared_ptr<const pcl::PointCloud<pcl::PointWit
让代码解决《线性代数》系列 - 求多项式的最大公因式
25.【判断是否是素数的方法】
[PCB] production document sorting and output of circuit board drawing notes -- drawing board notes
第五局 阿卡丽教学局 上
Stm32f407 based camera (ov7670 without FIFO) image acquisition and LCD display experiment - note sorting
Operating instructions for opt101 monolithic photodiode and single power supply mutual resistance amplifier
P1364 医院设置
In depth analysis - Data
随机推荐
第四局 借问酒家何处有?牧童遥指杏花村 下
记录关于写程序的一些个小芝士~【持续更~】
Deep analysis of string -- strlen & strtok
无法从“boost::shared_ptr<pcl::RangeImage>”转换为“const std::shared_ptr<const pcl::PointCloud<pcl::PointWit
11.【文件的二进制写入与写出】
无人机的微分平坦性详细推导
模拟实现字符串函数和内存函数(strlen,strcpy,strstr,memcpy.....)
Deep analysis recursion
(剑指offer版)字符串逆置
深度剖析 string —— strlen & strtok
碎碎念 碎碎念 下 原稿
1012 digital classification
Deep analysis of string -- strchr & strstr
Hetai ht32--4spi drive 0.96 inch OLED display implementation
Deep analysis of string -- memcpy & memmove
让代码解决《线性代数》系列 - 求多项式的最大公因式
(good pairs) assign the value of one array to another array
12.【I/O流get()与getline()与put()函数】
Doing questions leads to the understanding of getchar ()
深度理解指针(冒泡排序模拟实现qsort,函数指针实现回调函数)