1 #include <stdio.h>
2 #include <string.h>
3
4
5 int main()
6 {
7 int a[8]={1,2,3,4,5,6,7,8};
8 printf("%ld\n",sizeof(a));
9 for(int i=0;i<8;i++)
10 {
11 if(i%2==0)
12 {
13 a[i]=a[i]+2;
14 }
15 else
16 {
17 a[i]=3*a[i];
18 }
19 }
20 for(int i=0;i<8;i++)
21 printf("%-5d",a[i]);
22 printf("\n");
23
c语言基础
最新推荐文章于 2024-08-19 13:32:52 发布