射手的博客
学习Delphi,需要一个记录学习的博客,

 

#include <cstdlib>
#include 
<iostream>
#include 
<stdio.h>
using namespace std;
   

    
int main(int argc, char *argv[])
{    
         
struct Student
     
{
      
int  No;      
      
char *Name;
      
char Sex;
      
float Score;      
     }
;
     
int i;
     
struct Student Stu[3= 
     
{
       
{10,"LiPing",'M',800.5},
       
{11,"Wang Pan",'F',400.5},  // 性别注意是字符要用 ' ' 扩住初始化
       
{12,"Archer",'M',1000.5}  //注意最后一个结构体变量初始后不要加","号
       }
;     
    
for(i=0;i<3;i++)
     

      printf(
"No = %d ,Name = %s,Sex = %c,Score = %6.1f \n",
      Stu[i].No , Stu[i].Name , Stu[i].Sex , Stu[i].Score);
     }
 
    system(
"PAUSE");
    
return EXIT_SUCCESS;
}
posted on 2009-05-18 23:07 Archer 阅读(192) 评论(0)  编辑 收藏 引用 所属分类: C语言的学习
只有注册用户登录后才能发表评论。