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

导航

<2025年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
统计
  • 随笔 - 24
  • 文章 - 0
  • 评论 - 3
  • 引用 - 0

常用链接

留言簿(1)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

 

 

#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 阅读(211) 评论(0)  编辑 收藏 引用 所属分类: C语言的学习
只有注册用户登录后才能发表评论。