fork download
  1. #include<stdio.h>
  2. typedef struct{
  3. int id;
  4. char blood_type;
  5. double height;
  6. }list;
  7. int main(void){
  8. list data[]={
  9. {1,'A',165.2},{2,'O',155.5},
  10. };
  11. for(int i=0;i<2;i++){
  12. printf("id:%d\n",data[i].id);
  13. printf("blood_type:%c\n",data[i].blood_type);
  14. printf("height:%lf\n",data[i].height);
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
id:1
blood_type:A
height:165.200000
id:2
blood_type:O
height:155.500000