首先注意,字符串一般用char型数组储存,数组一般用int型数组储存。
字符串:
char name[20] = {0};
scanf("%s", name);
数组:
int c[10]={0};
for(int i=0:i<10;scanf("%d",&c[i++]);因为没有特点的类型,所以用循环解决。
首先注意,字符串一般用char型数组储存,数组一般用int型数组储存。
字符串:
char name[20] = {0};
scanf("%s", name);
数组:
int c[10]={0};
for(int i=0:i<10;scanf("%d",&c[i++]);因为没有特点的类型,所以用循环解决。