c语言输出%02和%2.0f都是什么意思啊,还有100310121,李明,M,19910519,72,83,90,82~为了得到这些内容

Python013

c语言输出%02和%2.0f都是什么意思啊,还有100310121,李明,M,19910519,72,83,90,82~为了得到这些内容,第1张

%10ld指的是以双精度输出数据其占十个单位,%8s指的是以字符串型输出数据且占8个单位,%3c指的是以字符型输出数据且前两位是空格,%6d指的是以整形数输出数据且占6个单位,%02d指的是以整形数输出数据湛亮个单位但是多余的空格补在数据后。

说实话你这问题我没太看懂

例子int

num[3]

=

{10,

20,

30}

在内存是这样存储的

num

0000000a,00000014,0000001e

//16进制形式

你给起始地址函数,那函数就指向了num的地址,int规定了他是16位的,所以引用的时候,就可以按顺序引用了。

传入函数大多都有一个范围值,以确定作用数组多少元素,以上例子数3。

#include"stdio.h"

#include"string.h"

int main()

{

char name[4][15]

int i,j

float score[3][7]

for(i=0i<3i++)

{

printf("enter a student name and five cuase score(english computer stat politics C):\n")

scanf("%s%f%f%f%f%f",name[i],&score[i][0],&score[i][1],&score[i][2],&score[i][3],&score[i][4])

score[i][6]=0

for(j=0j<5j++)

score[i][6]=score[i][j]

score[i][5]=score[i][6]/5

if(score[i][6]>=420)

{

puts(name[i])

for(j=0j<7j++)

printf("%.2f\t",score[i][j])

printf("\n")

}

}

printf("enter you want find name :")

scanf(name[3])

for(i=0i<3i++)

if(strcmp(name[i],name[3])==0)

printf("English score : %.2f\n",score[i][0])

}